Package javax.net.ssl
Class HandshakeCompletedEvent
- java.lang.Object
-
- java.util.EventObject
-
- javax.net.ssl.HandshakeCompletedEvent
-
- All Implemented Interfaces:
Serializable
public class HandshakeCompletedEvent extends EventObject
The event object encapsulating the information about a completed SSL handshake on a SSL connection.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description HandshakeCompletedEvent(SSLSocket sock, SSLSession s)Creates a newHandshakeCompletedEventwith the specified SSL socket and SSL session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCipherSuite()Returns the name of the cipher suite negotiated during this handshake.Certificate[]getLocalCertificates()Returns the list of local certificates used during the handshake.PrincipalgetLocalPrincipal()Returns thePrincipalused to identify during the handshake.X509Certificate[]getPeerCertificateChain()Returns the list of certificates identifying the peer.Certificate[]getPeerCertificates()Return the list of certificates identifying the peer during the handshake.PrincipalgetPeerPrincipal()Returns thePrincipalidentifying the peer.SSLSessiongetSession()Returns the SSL session associated with this event.SSLSocketgetSocket()Returns the SSL socket that produced this event.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
HandshakeCompletedEvent
public HandshakeCompletedEvent(SSLSocket sock, SSLSession s)
Creates a newHandshakeCompletedEventwith the specified SSL socket and SSL session.- Parameters:
sock- the SSL socket.s- the SSL session.
-
-
Method Detail
-
getSession
public SSLSession getSession()
Returns the SSL session associated with this event.- Returns:
- the SSL session associated with this event.
-
getCipherSuite
public String getCipherSuite()
Returns the name of the cipher suite negotiated during this handshake.- Returns:
- the name of the cipher suite negotiated during this handshake.
-
getLocalCertificates
public Certificate[] getLocalCertificates()
Returns the list of local certificates used during the handshake. These certificates were sent to the peer.- Returns:
- Returns the list of certificates used during the handshake with
the local identity certificate followed by CAs, or
nullif no certificates were used during the handshake.
-
getPeerCertificates
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
Return the list of certificates identifying the peer during the handshake.- Returns:
- the list of certificates identifying the peer with the peer's identity certificate followed by CAs.
- Throws:
SSLPeerUnverifiedException- if the identity of the peer has not been verified.
-
getPeerCertificateChain
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
Returns the list of certificates identifying the peer. The peer's identity certificate is followed by the validated certificate authority certificates.Replaced by:
getPeerCertificates()- Returns:
- the list of certificates identifying the peer
- Throws:
SSLPeerUnverifiedException- if the identity of the peer has not been verified.
-
getPeerPrincipal
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
Returns thePrincipalidentifying the peer.- Returns:
- the
Principalidentifying the peer. - Throws:
SSLPeerUnverifiedException- if the identity of the peer has not been verified.
-
getLocalPrincipal
public Principal getLocalPrincipal()
Returns thePrincipalused to identify during the handshake.- Returns:
- the
Principalused to identify during the handshake.
-
getSocket
public SSLSocket getSocket()
Returns the SSL socket that produced this event.- Returns:
- the SSL socket that produced this event.
-
-