is new.
java.lang.Objectjava.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.
| Field Summary |
|---|
| Fields inherited from class java.util. EventObject |
|---|
| source |
| Constructor Summary | |
|---|---|
|
HandshakeCompletedEvent
(
SSLSocket
sock,
SSLSession
s) Constructs a new HandshakeCompletedEvent. |
|
| Method Summary | |
|---|---|
| String |
getCipherSuite
() Returns the cipher suite in use by the session which was produced by the handshake. |
| Certificate [] |
getLocalCertificates
() Returns the certificate(s) that were sent to the peer during handshaking. |
Principal
|
getLocalPrincipal
()
Returns the principal that was sent to the peer during handshaking.
|
| X509Certificate [] |
getPeerCertificateChain
() Returns the identity of the peer which was identified as part of defining the session. |
| Certificate [] |
getPeerCertificates
() Returns the identity of the peer which was established as part of defining the session. |
Principal
|
getPeerPrincipal
()
Returns the identity of the peer which was established as part of defining the session.
|
| SSLSession |
getSession
() Returns the session that triggered this event. |
| SSLSocket |
getSocket
() 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 , wait , wait , wait |
| Constructor Detail |
|---|
public HandshakeCompletedEvent(SSLSocket sock,
SSLSession s)
| Method Detail |
|---|
public SSLSession getSession()
public String getCipherSuite()
public Certificate[] getLocalCertificates()
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.
See Also:
getLocalPrincipal()
public Certificate[] getPeerCertificates()
throws SSLPeerUnverifiedException
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.
See Also:
getPeerPrincipal()
public X509Certificate[] getPeerCertificateChain()
throws SSLPeerUnverifiedException
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.
See Also:
getPeerPrincipal()
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
Since:
1.5
See Also:
getPeerCertificates()
,
getLocalPrincipal()
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.
Since:
1.5
See Also:
getLocalCertificates()
,
getPeerPrincipal()
public SSLSocket getSocket()