Home » openjdk-7 » javax » net » ssl » [javadoc | source]
javax.net.ssl
public class: HandshakeCompletedEvent [javadoc | source]
java.lang.Object
   java.util.EventObject
      javax.net.ssl.HandshakeCompletedEvent
This event indicates that an SSL handshake completed on a given SSL connection. All of the core information about that handshake's result is captured through an "SSLSession" object. As a convenience, this event class provides direct access to some important session attributes.

The source of this event is the SSLSocket on which handshaking just completed.

Constructor:
 public HandshakeCompletedEvent(SSLSocket sock,
    SSLSession s) 
    Constructs a new HandshakeCompletedEvent.
    Parameters:
    sock - the SSLSocket acting as the source of the event
    s - the SSLSession this event is associated with
Method from javax.net.ssl.HandshakeCompletedEvent Summary:
getCipherSuite,   getLocalCertificates,   getLocalPrincipal,   getPeerCertificateChain,   getPeerCertificates,   getPeerPrincipal,   getSession,   getSocket
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.net.ssl.HandshakeCompletedEvent Detail:
 public String getCipherSuite() 
    Returns the cipher suite in use by the session which was produced by the handshake. (This is a convenience method for getting the ciphersuite from the SSLsession.)
 public Certificate[] getLocalCertificates() 
    Returns the certificate(s) that were sent to the peer during handshaking. Note: This method is useful only when using certificate-based cipher suites. When multiple certificates are available for use in a handshake, the implementation chooses what it considers the "best" certificate chain available, and transmits that to the other side. This method allows the caller to know which certificate chain was actually used.
 public Principal getLocalPrincipal() 
    Returns the principal that was sent to the peer during handshaking.
 public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException 
    Returns the identity of the peer which was identified as part of defining the session. Note: This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.

    Note: this method exists for compatibility with previous releases. New applications should use #getPeerCertificates instead.

 public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException 
    Returns the identity of the peer which was established as part of defining the session. Note: This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException.
 public Principal getPeerPrincipal() throws SSLPeerUnverifiedException 
    Returns the identity of the peer which was established as part of defining the session.
 public SSLSession getSession() 
    Returns the session that triggered this event.
 public SSLSocket getSocket() 
    Returns the socket which is the source of this event. (This is a convenience function, to let applications write code without type casts.)