javax.net.ssl

Class HandshakeCompletedEvent


public class HandshakeCompletedEvent
extends java.util.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.
Author:
Casey Marshall (rsdio@metastatic.org)

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.
X509Certificate[]
getPeerCertificateChain()
Certificate[]
getPeerCertificates()
Returns the peer's certificates being used in this connection.
SSLSession
getSession()
Returns the SSL session object associated with this connection.
SSLSocket
getSocket()
Returns the socket over which this connection is being negotiated.

Constructor Details

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.

Method Details

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.

getPeerCertificateChain

public X509Certificate[] getPeerCertificateChain()
            throws SSLPeerUnverifiedException

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.

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 java.util.EventObject.getSource() method.
Returns:
The socket.