public final class SSLSessionImpl
extends javax.net.ssl.ExtendedSSLSession
Servers have the ability to manage the sessions associated with their authentication context(s). They can do this by enumerating the IDs of the sessions which are cached, examining those sessions, and then perhaps invalidating a given session so that it can't be used again. If servers do not explicitly manage the cache, sessions will linger until memory is low enough that the runtime environment purges cache entries automatically to reclaim space.
The only reason this class is not package-private is that there's no other public way to get at the server session context which is associated with any given authentication context.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns true if sessions have same ids, false otherwise.
|
int |
getApplicationBufferSize()
Gets the current size of the largest application data that is
expected when using this session.
|
java.security.cert.X509Certificate[] |
getCertificateChain()
Return the cert chain presented by the peer.
|
java.lang.String |
getCipherSuite()
Returns the name of the cipher suite in use on this session
|
long |
getCreationTime()
Returns the time this session was created.
|
byte[] |
getId()
Returns the ID for this session.
|
long |
getLastAccessedTime()
Returns the last time this session was used to initialize
a connection.
|
java.security.cert.Certificate[] |
getLocalCertificates()
Return the cert chain presented to the peer in the
java.security.cert format.
|
java.security.Principal |
getLocalPrincipal()
Returns the principal that was sent to the peer during handshaking.
|
java.lang.String[] |
getLocalSupportedSignatureAlgorithms()
Gets an array of supported signature algorithms that the local side is
willing to verify.
|
int |
getPacketBufferSize()
Gets the current size of the largest SSL/TLS packet that is expected
when using this session.
|
java.net.InetAddress |
getPeerAddress()
Returns the network address of the session's peer.
|
javax.security.cert.X509Certificate[] |
getPeerCertificateChain()
Return the cert chain presented by the peer in the
javax.security.cert format.
|
java.security.cert.Certificate[] |
getPeerCertificates()
Return the cert chain presented by the peer in the
java.security.cert format.
|
java.lang.String |
getPeerHost() |
int |
getPeerPort()
Need to provide the port info for caching sessions based on
host and port.
|
java.security.Principal |
getPeerPrincipal()
Returns the identity of the peer which was established as part of
defining the session.
|
java.lang.String[] |
getPeerSupportedSignatureAlgorithms()
Gets an array of supported signature algorithms that the peer is
able to verify.
|
java.lang.String |
getProtocol()
Returns the standard name of the protocol in use on this session
|
java.util.List<javax.net.ssl.SNIServerName> |
getRequestedServerNames()
Obtains a
List containing all SNIServerName s
of the requested Server Name Indication (SNI) extension. |
javax.net.ssl.SSLSessionContext |
getSessionContext()
For server sessions, this returns the set of sessions which
are currently valid in this process.
|
java.lang.Object |
getValue(java.lang.String key)
Returns the specified session value.
|
java.lang.String[] |
getValueNames()
Lists the names of the session values.
|
int |
hashCode()
Returns the hashcode for this session
|
void |
invalidate()
Invalidate a session.
|
boolean |
isValid() |
void |
putValue(java.lang.String key,
java.lang.Object value)
Assigns a session value.
|
void |
removeValue(java.lang.String key)
Removes the specified session value, delivering a session changed
event as appropriate.
|
java.lang.String |
toString()
Returns a string representation of this SSL session
|
public boolean isValid()
public byte[] getId()
public javax.net.ssl.SSLSessionContext getSessionContext()
public java.lang.String getCipherSuite()
public java.lang.String getProtocol()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.security.cert.Certificate[] getPeerCertificates() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
public java.security.cert.Certificate[] getLocalCertificates()
public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
public java.security.cert.X509Certificate[] getCertificateChain() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
public java.security.Principal getPeerPrincipal() throws javax.net.ssl.SSLPeerUnverifiedException
javax.net.ssl.SSLPeerUnverifiedException
- if the peer's identity has not
been verifiedpublic java.security.Principal getLocalPrincipal()
public long getCreationTime()
public long getLastAccessedTime()
public java.net.InetAddress getPeerAddress()
public java.lang.String getPeerHost()
public int getPeerPort()
public void invalidate()
public void putValue(java.lang.String key, java.lang.Object value)
public java.lang.Object getValue(java.lang.String key)
public void removeValue(java.lang.String key)
public java.lang.String[] getValueNames()
public int getPacketBufferSize()
public int getApplicationBufferSize()
public java.lang.String[] getLocalSupportedSignatureAlgorithms()
getLocalSupportedSignatureAlgorithms
in class javax.net.ssl.ExtendedSSLSession
public java.lang.String[] getPeerSupportedSignatureAlgorithms()
getPeerSupportedSignatureAlgorithms
in class javax.net.ssl.ExtendedSSLSession
public java.util.List<javax.net.ssl.SNIServerName> getRequestedServerNames()
List
containing all SNIServerName
s
of the requested Server Name Indication (SNI) extension.getRequestedServerNames
in class javax.net.ssl.ExtendedSSLSession
public java.lang.String toString()
toString
in class java.lang.Object