javax.net.ssl
Class HandshakeCompletedEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.net.ssl.HandshakeCompletedEvent
All Implemented Interfaces:
Serializable

public class HandshakeCompletedEvent
extends EventObject

An event raised by a SSLSocket and passed to the HandshakeCompletedListener.handshakeCompleted(HandshakeCompletedEvent) method of all registered listeners when a SSL handshake in a SSL protocol is completed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
HandshakeCompletedEvent(SSLSocket socket, SSLSession session)
          Creates a new handshake completed event.
 
Method Summary
 String getCipherSuite()
          Returns the name of the cipher that was negotiated in this connection.
 Certificate[] getLocalCertificates()
          Returns the local certificates being used in this connection.
 Principal getLocalPrincipal()
          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.
 Principal getPeerPrincipal()
          Returns the peer's identity, or null if there is none.
 SSLSession getSession()
          Returns the SSL session object associated with this connection.
 SSLSocket getSocket()
          Returns the socket over which this connection is being negotiated.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

getPeerCertificates

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

Returns:
The peer's certificates.
Throws:
SSLPeerUnverifiedException - If the peer has not been verified.

getPeerCertificateChain

public X509Certificate[] getPeerCertificateChain()
                                          throws SSLPeerUnverifiedException
Throws:
SSLPeerUnverifiedException

getPeerPrincipal

public Principal getPeerPrincipal()
                           throws SSLPeerUnverifiedException
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 EventObject.getSource() method.

Returns:
The socket.