javax.net.ssl

Class HandshakeCompletedEvent

public class HandshakeCompletedEvent extends EventObject

An event raised by a SSLSocket and passed to the {@link HandshakeCompletedListener#handshakeCompleted(HandshakeCompletedEvent)} method of all registered listeners when a SSL handshake in a SSL protocol is completed.
Constructor Summary
HandshakeCompletedEvent(SSLSocket socket, SSLSession session)
Creates a new handshake completed event.
Method Summary
StringgetCipherSuite()
Returns the name of the cipher that was negotiated in this connection.
Certificate[]getLocalCertificates()
Returns the local certificates being used in this connection.
PrincipalgetLocalPrincipal()
Returns the local identity used in this connection, or null if there is none.
X509Certificate[]getPeerCertificateChain()
Certificate[]getPeerCertificates()
Returns the peer's certificates being used in this connection.
PrincipalgetPeerPrincipal()
Returns the peer's identity, or null if there is none.
SSLSessiongetSession()
Returns the SSL session object associated with this connection.
SSLSocketgetSocket()
Returns the socket over which this connection is being negotiated.

Constructor Detail

HandshakeCompletedEvent

public HandshakeCompletedEvent(SSLSocket socket, SSLSession session)
Creates a new handshake completed event.

Parameters: socket The socket (also the source) creating this event. session The associated session object.

Throws: NullPointerException If session is null.

Method Detail

getCipherSuite

public String getCipherSuite()
Returns the name of the cipher that was negotiated in this connection.

Returns: The negotiated cipher name.

getLocalCertificates

public Certificate[] getLocalCertificates()
Returns the local certificates being used in this connection.

Returns: The local certificates.

getLocalPrincipal

public Principal getLocalPrincipal()
Returns the local identity used in this connection, or null if there is none.

Returns: The local identity.

Since: 1.5

getPeerCertificateChain

public X509Certificate[] getPeerCertificateChain()

getPeerCertificates

public Certificate[] getPeerCertificates()
Returns the peer's certificates being used in this connection.

Returns: The peer's certificates.

Throws: SSLPeerUnverifiedException If the peer has not been verified.

getPeerPrincipal

public Principal getPeerPrincipal()
Returns the peer's identity, or null if there is none.

Returns: The peer's identity.

Throws: SSLPeerUnverifiedException If the remote peer's identity could not be verified.

Since: 1.5

getSession

public SSLSession getSession()
Returns the SSL session object associated with this connection.

Returns: The session object.

getSocket

public SSLSocket getSocket()
Returns the socket over which this connection is being negotiated. This method is equivalent to the {@link java.util.EventObject#getSource()} method.

Returns: The socket.