This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


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

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.

See Also (auto-generated):

SSLSession

SSLSocket

SSLSocketFactory


Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary

          Constructs a new HandshakeCompletedEvent.
 
Method Summary
 String

          Returns the cipher suite in use by the session which was produced by the handshake.
 Certificate[]

          Returns the certificate(s) that were sent to the peer during handshaking.
 Principal

          Returns the principal that was sent to the peer during handshaking.
 X509Certificate[]

          Returns the identity of the peer which was identified as part of defining the session.
 Certificate[]

          Returns the identity of the peer which was established as part of defining the session.
 Principal

          Returns the identity of the peer which was established as part of defining the session.
 SSLSession

          Returns the session that triggered this event.
 SSLSocket

          Returns the socket which is the source of this event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandshakeCompletedEvent

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 Detail

getCipherSuite

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.)

Returns:
the name of the cipher suite negotiated during this session.

getLocalCertificates

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.

Returns:
an ordered array of certificates, with the local certificate first followed by any certificate authorities. If no certificates were sent, then null is returned.

getLocalPrincipal

public Principal getLocalPrincipal()
Returns the principal that was sent to the peer during handshaking.

Returns:
the principal sent to the peer. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned.

getPeerCertificateChain

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 {@link #getPeerCertificates} instead.

Returns:
an ordered array of peer X.509 certificates, with the peer's own certificate first followed by any certificate authorities. (The certificates are in the original JSSE {@link javax.security.cert.X509Certificate} format).
Throws:
SSLPeerUnverifiedException - if the peer is not verified.

getPeerCertificates

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.

Returns:
an ordered array of the peer certificates, with the peer's own certificate first followed by any certificate authorities.
Throws:
SSLPeerUnverifiedException - if the peer is not verified.

getPeerPrincipal

public Principal getPeerPrincipal()
                           throws SSLPeerUnverifiedException
Returns the identity of the peer which was established as part of defining the session.

Returns:
the peer's principal. Returns an X500Principal of the end-entity certiticate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites.
Throws:
SSLPeerUnverifiedException - if the peer's identity has not been verified

getSession

public SSLSession getSession()
Returns the session that triggered this event.

Returns:
the SSLSession for this handshake

getSocket

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.)

Returns:
the socket on which the connection was made.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.