Serializable
public class HandshakeCompletedEvent extends EventObject
The source of this event is the SSLSocket on which handshaking just completed.
source
Constructor | Description |
---|---|
HandshakeCompletedEvent |
Constructs a new HandshakeCompletedEvent. |
Modifier and Type | Method | Description |
---|---|---|
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() |
Deprecated, for removal: This API element is subject to removal in a future version. |
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. |
getSource, toString
public HandshakeCompletedEvent(SSLSocket sock, SSLSession s)
sock
- the SSLSocket acting as the source of the events
- the SSLSession this event is associated withpublic SSLSession getSession()
SSLSession
for this handshakepublic String getCipherSuite()
public Certificate[] getLocalCertificates()
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
Note: The returned value may not be a valid certificate chain and should not be relied on for trust decisions.
SSLPeerUnverifiedException
- if the peer is not verified.@Deprecated(since="9", forRemoval=true) public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
getPeerCertificates()
method that returns an array of java.security.cert.Certificate
should be used instead.Note: The returned value may not be a valid certificate chain and should not be relied on for trust decisions.
Note: this method exists for compatibility with previous releases. New applications should use getPeerCertificates()
instead.
X509Certificate
format).SSLPeerUnverifiedException
- if the peer is not verified.UnsupportedOperationException
- if the underlying provider does not implement the SSLSession.getPeerCertificateChain()
operation.public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
SSLPeerUnverifiedException
- if the peer's identity has not been verifiedpublic Principal getLocalPrincipal()
public SSLSocket getSocket()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/javax/net/ssl/HandshakeCompletedEvent.html
getPeerCertificates()
method that returns an array ofjava.security.cert.Certificate
should be used instead.