invalidate.
Session management policies are typically used to tune performance.
In addition to the standard session attributes, SSL sessions expose these read-only attributes:
Sessions may be explicitly invalidated. Invalidation may also be done implicitly, when faced with certain kinds of errors.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the current maximum expected application packet sizeGets the current size of the largest application data that is expected when using this session. |
| public String | Returns: the name of the session's cipher suiteReturns the name of the SSL cipher suite which is used for all connections in the session. |
| public long | Returns: the time this Session was createdReturns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC. |
| public byte[] | |
| public long | Returns: the last time this Session was accessedReturns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC. |
| public Certificate[] | 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.Returns the certificate(s) that were sent to the peer during handshaking. |
| public Principal | 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.Returns the principal that was sent to the peer during handshaking. |
| public int | Returns: the current maximum expected network packet sizeGets the current size of the largest SSL/TLS/DTLS packet that is expected when using this session. |
| public default X509Certificate[] | 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 certificatejavax. format.)
Deprecated
for removal since 9. The
getPeerCertificates() method that returns an
array of java.security.cert.Certificate should
be used instead.
Returns the identity of the peer which was identified as part of defining the session. |
| public Certificate[] | Returns: an ordered array of peer certificates, with the peer's own certificate first followed by any certificate authorities.Returns the identity of the peer which was established as part of defining the session. |
| public String | Returns: the host name of the peer host, or null if no information is available.Returns the host name of the peer in this session. |
| public int | Returns: the port number of the peer host, or -1 if no information is available.Returns the port number of the peer in this session. |
| public Principal | Returns: the peer's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites, and KerberosPrincipal for Kerberos cipher suites.Returns the identity of the peer which was established as part of defining the session. |
| public String | Returns: the standard name of the protocol used for all connections in the session.Returns the standard name of the protocol used for all connections in the session. |
| public SSLSessionContext | Returns: the session context used for this session, or null if the context is unavailable.Returns the context in which this session is bound. |
| public Object | |
| public String[] | Returns: a non-null (possibly empty) array of names of the objects bound to this Session.Returns an array of the names of all the application layer data objects bound into the Session. |
| public void | |
| public boolean | Returns: true if this session may be rejoined.Returns whether this session is valid and available for resuming or joining. |
| public void | |
| public void | removeValue(String
the name of the object to remove name)Removes the object bound to the given name in the session's application layer data. |
| getApplicationBufferSize | back to summary |
|---|---|
| public int getApplicationBufferSize() Gets the current size of the largest application data that is expected when using this session.
| |
| getCipherSuite | back to summary |
|---|---|
| public String getCipherSuite() Returns the name of the SSL cipher suite which is used for all connections in the session. This defines the level of protection provided to the data sent on the connection, including the kind of encryption used and most aspects of how authentication is done.
| |
| getCreationTime | back to summary |
|---|---|
| public long getCreationTime() Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.
| |
| getId | back to summary |
|---|---|
| public byte[] getId() Returns the identifier assigned to this Session.
| |
| getLastAccessedTime | back to summary |
|---|---|
| public long getLastAccessedTime() Returns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC. Access indicates a new connection being established using session data. Application level operations, such as getting or setting a value associated with the session, are not reflected in this access time. This information is particularly useful in session management policies. For example, a session manager thread could leave all sessions in a given context which haven't been used in a long time; or, the sessions might be sorted according to age to optimize some task.
| |
| getLocalCertificates | back to summary |
|---|---|
| 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.
| |
| getLocalPrincipal | back to summary |
|---|---|
| public Principal getLocalPrincipal() Returns the principal that was sent to the peer during handshaking.
| |
| getPacketBufferSize | back to summary |
|---|---|
| public int getPacketBufferSize() Gets the current size of the largest SSL/TLS/DTLS packet that is expected when using this session.
An
| |
| getPeerCertificateChain | back to summary |
|---|---|
| public default X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
Deprecated for removal since 9. The 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 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
Implementation Specification This default implementation throws UnsupportedOperationException.
| |
| getPeerCertificates | back to summary |
|---|---|
| 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. Note The returned value may not be a valid certificate chain and should not be relied on for trust decisions.
| |
| getPeerHost | back to summary |
|---|---|
| public String getPeerHost() Returns the host name of the peer in this session. For the server, this is the client's host; and for the client, it is the server's host. The name may not be a fully qualified host name or even a host name at all as it may represent a string encoding of the peer's network address. If such a name is desired, it might be resolved through a name service based on the value returned by this method.
This value is not authenticated and should not be relied upon.
It is mainly used as a hint for
| |
| getPeerPort | back to summary |
|---|---|
| public int getPeerPort() Returns the port number of the peer in this session. For the server, this is the client's port number; and for the client, it is the server's port number.
This value is not authenticated and should not be relied upon.
It is mainly used as a hint for
| |
| getPeerPrincipal | back to summary |
|---|---|
| public Principal getPeerPrincipal() throws SSLPeerUnverifiedException Returns the identity of the peer which was established as part of defining the session.
| |
| getProtocol | back to summary |
|---|---|
| public String getProtocol() Returns the standard name of the protocol used for all connections in the session. This defines the protocol used in the connection.
| |
| getSessionContext | back to summary |
|---|---|
| public SSLSessionContext getSessionContext() Returns the context in which this session is bound. This context may be unavailable in some environments, in which case this method returns null.
| |
| getValue | back to summary |
|---|---|
| public Object getValue(String name) Returns the object bound to the given name in the session's application layer data. Returns null if there is no such binding.
| |
| getValueNames | back to summary |
|---|---|
| public String[] getValueNames() Returns an array of the names of all the application layer data objects bound into the Session.
| |
| invalidate | back to summary |
|---|---|
| public void invalidate() Invalidates the session. Future connections will not be able to resume or join this session. However, any existing connection using this session can continue to use the session until the connection is closed.
| |
| isValid | back to summary |
|---|---|
| public boolean isValid() Returns whether this session is valid and available for resuming or joining.
| |
| putValue | back to summary |
|---|---|
| public void putValue(String name, Object value) Binds the specified
Any existing binding using the same
| |
| removeValue | back to summary |
|---|---|
| public void removeValue(String name) Removes the object bound to the given name in the session's
application layer data. Does nothing if there is no object
bound to the given name. If the bound existing object
implements the
| |