APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.ssl

pack-priv final Class SSLSessionImpl

extends ExtendedSSLSession
Class Inheritance
Imports
java.io.IOException, java.net.InetAddress, java.nio.ByteBuffer, java.nio.charset.StandardCharsets, java.security.*, java.security.cert.X509Certificate, java.util.ArrayList, .Arrays, .Collection, .Collections, .List, .Objects, .Queue, java.util.concurrent.ConcurrentHashMap, .ConcurrentLinkedQueue, java.util.concurrent.locks.ReentrantLock, java.util.zip.Adler32, javax.crypto.KDF, .KeyGenerator, .SecretKey, javax.crypto.spec.HKDFParameterSpec, .SecretKeySpec, javax.net.ssl.*, sun.security.ssl.CipherSuite.HashAlg, .X509Authentication.X509Possession, sun.security.internal.spec.TlsPrfParameterSpec, sun.security.util.KeyUtil, sun.security.provider.X509Factory

Implements the SSL session interface, and exposes the session context which is maintained by SSL servers.

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.

Author
David Brownell

Field Summary

Modifier and TypeField and Description
private boolean
acceptLargeFragments

Use large packet sizes now or follow RFC 2246 packet sizes (2^14) until changed.

private final ConcurrentHashMap<String, Object>
private final Queue<SSLSessionImpl>
private CipherSuite
private RandomCookie
private SSLSessionContextImpl
private final long
private static final ArrayList<SignatureScheme>
private static final boolean
private SecretKey
private final String
private final String
private boolean
private boolean
private long
private X509Certificate[]
private PrivateKey
private final Collection<SignatureScheme>
private SecretKey
private int
private int
private X509Certificate[]
private Collection<SignatureScheme>
private final int
private SecretKey
private final ProtocolVersion
private byte[]
private final List<SNIServerName>
private SecretKey
pack-priv final SNIServerName
private RandomCookie
private final SessionId
private final ReentrantLock
private List<byte[]>
private int
private final long
private byte
pack-priv boolean
private boolean
pack-priv final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv
pack-priv
SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite, SessionId id, long creationTime)

pack-priv
pack-priv
SSLSessionImpl(HandshakeContext hc, ByteBuffer buf)

Reassemble new session ticket.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv SecretKey
pack-priv byte[]
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Returns true if sessions have same ids, false otherwise.

pack-priv void
expandBufferSizes()

Expand the buffer size of both SSL/TLS network packet and application data.

public Object
exportKeyingMaterial(String keyAlg, String label, byte[] context, int length)

public byte[]
exportKeyingMaterialData(String label, byte[] context, int length)

Overrides javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialData.

Generate Exported Key Material (EKM) calculated according to the algorithms defined in RFCs 5705/8446.

public SecretKey
exportKeyingMaterialKey(String keyAlg, String label, byte[] context, int length)

Overrides javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialKey.

Generate Exported Key Material (EKM) calculated according to the algorithms defined in RFCs 5705/8446.

pack-priv SSLSessionImpl
public int
getApplicationBufferSize()

Implements javax.net.ssl.SSLSession.getApplicationBufferSize.

Gets the current size of the largest application data that is expected when using this session.

public X509Certificate[]

Returns:

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.
getCertificateChain
()

Return the cert chain presented by the peer.

private static int
getChecksum(byte[] input)

public String
getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

Returns the name of the cipher suite in use on this session

public long
getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Returns the time this session was created.

public byte[]
getId()

Implements javax.net.ssl.SSLSession.getId.

Returns the ID for this session.

pack-priv String
public long
getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

Returns the last time this session was used to initialize a connection.

public Certificate[]

Returns:

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.
getLocalCertificates
()

Implements javax.net.ssl.SSLSession.getLocalCertificates.

Return the cert chain presented to the peer in the java.security.cert format.

public Principal

Returns:

the principal sent to the peer. Returns an X500Principal of the end-entity certificate for X509-based cipher suites. If no principal was sent, then null is returned.
getLocalPrincipal
()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Returns the principal that was sent to the peer during handshaking.

public String[]
getLocalSupportedSignatureAlgorithms()

Implements abstract javax.net.ssl.ExtendedSSLSession.getLocalSupportedSignatureAlgorithms.

Gets an array of supported signature algorithm names that the local side is willing to verify.

pack-priv Collection<SignatureScheme>
getLocalSupportedSignatureSchemes()

Gets a collection of supported signature schemes that the local side is willing to verify.

pack-priv SecretKey
getMasterSecret()

Returns the master secret ...

pack-priv int
pack-priv int

Returns:

the negotiated maximum fragment length, or -1 if no such length has been negotiated.
getNegotiatedMaxFragSize
()

Get the negotiated maximum fragment length, as specified by the max_fragment_length ClientHello extension in RFC 6066.

public int
getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Gets the current size of the largest SSL/TLS packet that is expected when using this session.

public InetAddress
getPeerAddress()

Returns the network address of the session's peer.

public Certificate[]

Returns:

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.
getPeerCertificates
()

Implements javax.net.ssl.SSLSession.getPeerCertificates.

Return the cert chain presented by the peer in the java.security.cert format.

public String
getPeerHost()

Implements javax.net.ssl.SSLSession.getPeerHost.

Returns the host name of the peer in this session.

public int
getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

Need to provide the port info for caching sessions based on host and port.

public Principal

Returns:

the peer's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites.
getPeerPrincipal
()

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Returns the identity of the peer which was established as part of defining the session.

public String[]
getPeerSupportedSignatureAlgorithms()

Implements abstract javax.net.ssl.ExtendedSSLSession.getPeerSupportedSignatureAlgorithms.

Gets an array of supported signature algorithms that the peer is able to verify.

pack-priv Collection<SignatureScheme>
getPeerSupportedSignatureSchemes()

Gets a collection of supported signature schemes that the peer is willing to verify.

pack-priv SecretKey
public String
getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol in use on this session

pack-priv ProtocolVersion
pack-priv byte[]
public List<SNIServerName>
getRequestedServerNames()

Overrides javax.net.ssl.ExtendedSSLSession.getRequestedServerNames.

Obtains a List containing all SNIServerNames of the requested Server Name Indication (SNI) extension.

pack-priv SecretKey
public SSLSessionContext
getSessionContext()

Implements javax.net.ssl.SSLSession.getSessionContext.

For server sessions, this returns the set of sessions which are currently valid in this process.

pack-priv SessionId
public List<byte[]>

Returns:

an unmodifiable List of byte arrays, each consisting of a DER-encoded OCSP response (see RFC 6960). If no responses have been presented by the server or non-certificate based server authentication is used then an empty List is returned.
getStatusResponses
()

Overrides javax.net.ssl.ExtendedSSLSession.getStatusResponses.

Return a List of status responses presented by the peer.

pack-priv CipherSuite
getSuite()

Returns the cipher spec in use on this session

pack-priv int
public long
public Object
getValue(String key)

Implements javax.net.ssl.SSLSession.getValue.

Returns the specified session value.

public String[]
getValueNames()

Implements javax.net.ssl.SSLSession.getValueNames.

Lists the names of the session values.

public int

Returns:

the hashcode for this session
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this session.

pack-priv byte[]
public void
invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

Invalidate a session.

private boolean
isLocalAuthenticationValid()

Check if the authentication used when establishing this session is still valid.

public boolean
pack-priv boolean
pack-priv boolean
isRejoinable()

Returns true iff this session may be resumed ...

pack-priv boolean
isSessionResumption()

Return true if the session is currently re-established with a session-resumption abbreviated initial handshake.

pack-priv boolean
public boolean
isValid()

Implements javax.net.ssl.SSLSession.isValid.

Returns whether this session is valid and available for resuming or joining.

public void
putValue(String key, Object value)

Implements javax.net.ssl.SSLSession.putValue.

Assigns a session value.

public void
removeValue(String key)

Implements javax.net.ssl.SSLSession.removeValue.

Removes the specified session value, delivering a session changed event as appropriate.

pack-priv void
setAsSessionResumption(boolean flag)

Resets whether the session is re-established with a session-resumption abbreviated initial handshake.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
setMaximumPacketSize(int maximumPacketSize)

pack-priv void
setNegotiatedMaxFragSize(int
the negotiated maximum fragment length, or -1 if no such length has been negotiated.
negotiatedMaxFragLen
)

Sets the negotiated maximum fragment length, as specified by the max_fragment_length ClientHello extension in RFC 6066.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
setPskIdentity(byte[] pskIdentity)

pack-priv void
pack-priv void
pack-priv void
setStatusResponses(List<byte[]>
a List of responses in binary form.
responses
)

Provide status response data obtained during the SSL handshake.

pack-priv void
setSuite(CipherSuite suite)

Resets the cipher spec in use on this session

pack-priv void
setTicketAgeAdd(int ticketAgeAdd)

pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this SSL session

pack-priv byte[]
write()

Write out a SSLSessionImpl in a byte array for a stateless session ticket

Field Detail

acceptLargeFragmentsback to summary
private boolean acceptLargeFragments

Use large packet sizes now or follow RFC 2246 packet sizes (2^14) until changed.

In the TLS specification (section 6.2.1, RFC2246), it is not recommended that the plaintext has more than 2^14 bytes. However, some TLS implementations violate the specification. This is a workaround for interoperability with these stacks.

Application could accept large fragments up to 2^15 bytes by setting the system property jsse.SSLEngine.acceptLargeFragments to "true".

boundValuesback to summary
private final ConcurrentHashMap<String, Object> boundValues
childSessionsback to summary
private final Queue<SSLSessionImpl> childSessions
cipherSuiteback to summary
private CipherSuite cipherSuite
clientRandomback to summary
private RandomCookie clientRandom
contextback to summary
private SSLSessionContextImpl context
creationTimeback to summary
private final long creationTime
defaultPeerSupportedSignAlgsback to summary
private static final ArrayList<SignatureScheme> defaultPeerSupportedSignAlgs
defaultRejoinableback to summary
private static final boolean defaultRejoinable
exporterMasterSecretback to summary
private SecretKey exporterMasterSecret
hostback to summary
private final String host
identificationProtocolback to summary
private final String identificationProtocol
invalidatedback to summary
private boolean invalidated
isSessionResumptionback to summary
private boolean isSessionResumption
lastUsedTimeback to summary
private long lastUsedTime
localCertsback to summary
private X509Certificate[] localCerts
localPrivateKeyback to summary
private PrivateKey localPrivateKey
localSupportedSignAlgsback to summary
private final Collection<SignatureScheme> localSupportedSignAlgs
masterSecretback to summary
private SecretKey masterSecret
maximumPacketSizeback to summary
private int maximumPacketSize
negotiatedMaxFragLenback to summary
private int negotiatedMaxFragLen
peerCertsback to summary
private X509Certificate[] peerCerts
peerSupportedSignAlgsback to summary
private Collection<SignatureScheme> peerSupportedSignAlgs
portback to summary
private final int port
preSharedKeyback to summary
private SecretKey preSharedKey
protocolVersionback to summary
private final ProtocolVersion protocolVersion
pskIdentityback to summary
private byte[] pskIdentity
requestedServerNamesback to summary
private final List<SNIServerName> requestedServerNames
resumptionMasterSecretback to summary
private SecretKey resumptionMasterSecret
serverNameIndicationback to summary
pack-priv final SNIServerName serverNameIndication
serverRandomback to summary
private RandomCookie serverRandom
sessionIdback to summary
private final SessionId sessionId
sessionLockback to summary
private final ReentrantLock sessionLock
statusResponsesback to summary
private List<byte[]> statusResponses
ticketAgeAddback to summary
private int ticketAgeAdd
ticketCreationTimeback to summary
private final long ticketCreationTime
ticketNonceCounterback to summary
private byte ticketNonceCounter
updateNSTback to summary
pack-priv boolean updateNST
useDefaultPeerSignAlgsback to summary
private boolean useDefaultPeerSignAlgs
useExtendedMasterSecretback to summary
pack-priv final boolean useExtendedMasterSecret

Constructor Detail

SSLSessionImplback to summary
pack-priv SSLSessionImpl()
SSLSessionImplback to summary
pack-priv SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite)
SSLSessionImplback to summary
pack-priv SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite, SessionId id)
SSLSessionImplback to summary
pack-priv SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite, SessionId id, long creationTime)
SSLSessionImplback to summary
pack-priv SSLSessionImpl(SSLSessionImpl baseSession, SessionId newId)
SSLSessionImplback to summary
pack-priv SSLSessionImpl(HandshakeContext hc, ByteBuffer buf) throws IOException

Reassemble new session ticket.

< 2 bytes > protocolVersion < 2 bytes > cipherSuite < 1 byte > localSupportedSignAlgs entries < 2 bytes per entries > localSupportedSignAlgs select (protocolVersion) case TLS13Plus: < 2 bytes > preSharedKey length < length in bytes > preSharedKey case non-TLS13Plus: < 2 bytes > masterSecretKey length < length in bytes> masterSecretKey < 1 byte > useExtendedMasterSecret < 1 byte > identificationProtocol length < length in bytes > identificationProtocol < 1 byte > serverNameIndication length < length in bytes > serverNameIndication < 1 byte > Number of requestedServerNames entries For each entry { < 1 byte > ServerName length < length in bytes > ServerName } < 4 bytes > maximumPacketSize < 4 bytes > negotiatedMaxFragSize < 4 bytes > creationTime < 1 byte > Length of peer host < length in bytes > peer host < 2 bytes> peer port < 1 byte > Number of Peer Certificate entries For each entry { < 4 bytes > Peer certificate length < length in bytes> Peer certificate } < 1 byte > Number of Local Certificate entries For each entry { < 1 byte > Local Certificate algorithm length < length in bytes> Local Certificate algorithm < 4 bytes > Certificate checksum }

Method Detail

addChildback to summary
pack-priv void addChild(SSLSessionImpl session)
consumePreSharedKeyback to summary
pack-priv SecretKey consumePreSharedKey()
consumePskIdentityback to summary
pack-priv byte[] consumePskIdentity()
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Returns true if sessions have same ids, false otherwise.

Annotations
@Override
expandBufferSizesback to summary
pack-priv void expandBufferSizes()

Expand the buffer size of both SSL/TLS network packet and application data.

exportKeyingMaterialback to summary
public Object exportKeyingMaterial(String keyAlg, String label, byte[] context, int length) throws SSLKeyException
exportKeyingMaterialDataback to summary
public byte[] exportKeyingMaterialData(String label, byte[] context, int length) throws SSLKeyException

Overrides javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialData.

Generate Exported Key Material (EKM) calculated according to the algorithms defined in RFCs 5705/8446.

Annotations
@Override
Exceptions
SSLKeyException:

Doc from javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialData.

if the key cannot be generated

exportKeyingMaterialKeyback to summary
public SecretKey exportKeyingMaterialKey(String keyAlg, String label, byte[] context, int length) throws SSLKeyException

Overrides javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialKey.

Generate Exported Key Material (EKM) calculated according to the algorithms defined in RFCs 5705/8446.

Annotations
@Override
Exceptions
SSLKeyException:

Doc from javax.net.ssl.ExtendedSSLSession.exportKeyingMaterialKey.

if the key cannot be generated

finishback to summary
pack-priv SSLSessionImpl finish()
getApplicationBufferSizeback to summary
public int getApplicationBufferSize()

Implements javax.net.ssl.SSLSession.getApplicationBufferSize.

Gets the current size of the largest application data that is expected when using this session.

Annotations
@Override
getCertificateChainback to summary
public X509Certificate[] getCertificateChain() throws SSLPeerUnverifiedException

Return the cert chain presented by the peer.

Note

This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites will throw an SSLPeerUnverifiedException.

Returns:X509Certificate[]

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.

getChecksumback to summary
private static int getChecksum(byte[] input)
getCipherSuiteback to summary
public String getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

Returns the name of the cipher suite in use on this session

Annotations
@Override
getCreationTimeback to summary
public long getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Returns the time this session was created.

Annotations
@Override
getIdback to summary
public byte[] getId()

Implements javax.net.ssl.SSLSession.getId.

Returns the ID for this session. The ID is fixed for the duration of the session; neither it, nor its value, changes.

Annotations
@Override
getIdentificationProtocolback to summary
pack-priv String getIdentificationProtocol()
getLastAccessedTimeback to summary
public long getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

Returns the last time this session was used to initialize a connection.

Annotations
@Override
getLocalCertificatesback to summary
public Certificate[] getLocalCertificates()

Implements javax.net.ssl.SSLSession.getLocalCertificates.

Return the cert chain presented to the peer in the java.security.cert format.

Note

This method is useful only when using certificate-based cipher suites.

Returns:Certificate[]

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.

Annotations
@Override
getLocalPrincipalback to summary
public Principal getLocalPrincipal()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Returns the principal that was sent to the peer during handshaking.

Returns:Principal

the principal sent to the peer. Returns an X500Principal of the end-entity certificate for X509-based cipher suites. If no principal was sent, then null is returned.

Annotations
@Override
getLocalSupportedSignatureAlgorithmsback to summary
public String[] getLocalSupportedSignatureAlgorithms()

Implements abstract javax.net.ssl.ExtendedSSLSession.getLocalSupportedSignatureAlgorithms.

Gets an array of supported signature algorithm names that the local side is willing to verify.

Annotations
@Override
getLocalSupportedSignatureSchemesback to summary
pack-priv Collection<SignatureScheme> getLocalSupportedSignatureSchemes()

Gets a collection of supported signature schemes that the local side is willing to verify.

getMasterSecretback to summary
pack-priv SecretKey getMasterSecret()

Returns the master secret ... treat with extreme caution!

getMaximumPacketSizeback to summary
pack-priv int getMaximumPacketSize()
getNegotiatedMaxFragSizeback to summary
pack-priv int getNegotiatedMaxFragSize()

Get the negotiated maximum fragment length, as specified by the max_fragment_length ClientHello extension in RFC 6066.

Returns:int

the negotiated maximum fragment length, or -1 if no such length has been negotiated.

getPacketBufferSizeback to summary
public int getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Gets the current size of the largest SSL/TLS packet that is expected when using this session.

Annotations
@Override
getPeerAddressback to summary
public InetAddress getPeerAddress()

Returns the network address of the session's peer. This implementation does not insist that connections between different ports on the same host must necessarily belong to different sessions, though that is of course allowed.

getPeerCertificatesback to summary
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException

Implements javax.net.ssl.SSLSession.getPeerCertificates.

Return the cert chain presented by the peer in the java.security.cert format.

Note

This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites will throw an SSLPeerUnverifiedException.

Returns:Certificate[]

array of peer X.509 certs, with the peer's own cert first in the chain, and with the "root" CA last.

Annotations
@Override
Exceptions
SSLPeerUnverifiedException:

Doc from javax.net.ssl.SSLSession.getPeerCertificates.

if the peer's identity has not been verified

getPeerHostback to summary
public String getPeerHost()

Implements javax.net.ssl.SSLSession.getPeerHost.

Doc from javax.net.ssl.SSLSession.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 SSLSession caching strategies.

Annotations
@Override
getPeerPortback to summary
public int getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

Need to provide the port info for caching sessions based on host and port. Accessed by SSLSessionContextImpl

Annotations
@Override
getPeerPrincipalback to summary
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Returns the identity of the peer which was established as part of defining the session.

Returns:Principal

the peer's principal. Returns an X500Principal of the end-entity certificate for X509-based cipher suites.

Annotations
@Override
Exceptions
SSLPeerUnverifiedException:
if the peer's identity has not been verified
getPeerSupportedSignatureAlgorithmsback to summary
public String[] getPeerSupportedSignatureAlgorithms()

Implements abstract javax.net.ssl.ExtendedSSLSession.getPeerSupportedSignatureAlgorithms.

Gets an array of supported signature algorithms that the peer is able to verify.

Annotations
@Override
getPeerSupportedSignatureSchemesback to summary
pack-priv Collection<SignatureScheme> getPeerSupportedSignatureSchemes()

Gets a collection of supported signature schemes that the peer is willing to verify. Those are sent with the "signature_algorithms_cert" TLS extension.

getPreSharedKeyback to summary
pack-priv SecretKey getPreSharedKey()
getProtocolback to summary
public String getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol in use on this session

Annotations
@Override
getProtocolVersionback to summary
pack-priv ProtocolVersion getProtocolVersion()
getPskIdentityback to summary
pack-priv byte[] getPskIdentity()
getRequestedServerNamesback to summary
public List<SNIServerName> getRequestedServerNames()

Overrides javax.net.ssl.ExtendedSSLSession.getRequestedServerNames.

Obtains a List containing all SNIServerNames of the requested Server Name Indication (SNI) extension.

Annotations
@Override
getResumptionMasterSecretback to summary
pack-priv SecretKey getResumptionMasterSecret()
getSessionContextback to summary
public SSLSessionContext getSessionContext()

Implements javax.net.ssl.SSLSession.getSessionContext.

For server sessions, this returns the set of sessions which are currently valid in this process. For client sessions, this returns null.

Annotations
@Override
getSessionIdback to summary
pack-priv SessionId getSessionId()
getStatusResponsesback to summary
public List<byte[]> getStatusResponses()

Overrides javax.net.ssl.ExtendedSSLSession.getStatusResponses.

Return a List of status responses presented by the peer.

Note

This method can be used only when using certificate-based server authentication; otherwise an empty List will be returned.

Returns:List<byte[]>

an unmodifiable List of byte arrays, each consisting of a DER-encoded OCSP response (see RFC 6960). If no responses have been presented by the server or non-certificate based server authentication is used then an empty List is returned.

Annotations
@Override
getSuiteback to summary
pack-priv CipherSuite getSuite()

Returns the cipher spec in use on this session

getTicketAgeAddback to summary
pack-priv int getTicketAgeAdd()
getTicketCreationTimeback to summary
public long getTicketCreationTime()
getValueback to summary
public Object getValue(String key)

Implements javax.net.ssl.SSLSession.getValue.

Returns the specified session value.

Annotations
@Override
getValueNamesback to summary
public String[] getValueNames()

Implements javax.net.ssl.SSLSession.getValueNames.

Lists the names of the session values.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hashcode for this session.

Returns:int

the hashcode for this session

Annotations
@Override
incrTicketNonceCounterback to summary
pack-priv byte[] incrTicketNonceCounter()
invalidateback to summary
public void invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

Invalidate a session. Active connections may still exist, but no connections will be able to rejoin this session.

Annotations
@Override
isLocalAuthenticationValidback to summary
private boolean isLocalAuthenticationValid()

Check if the authentication used when establishing this session is still valid. Returns true if no authentication was used

isPSKback to summary
public boolean isPSK()
isPSKableback to summary
pack-priv boolean isPSKable()
isRejoinableback to summary
pack-priv boolean isRejoinable()

Returns true iff this session may be resumed ... sessions are usually resumable. Security policies may suggest otherwise, for example sessions that haven't been used for a while (say, a working day) won't be resumable, and sessions might have a maximum lifetime in any case.

isSessionResumptionback to summary
pack-priv boolean isSessionResumption()

Return true if the session is currently re-established with a session-resumption abbreviated initial handshake.

isStatelessableback to summary
pack-priv boolean isStatelessable()
isValidback to summary
public boolean isValid()

Implements javax.net.ssl.SSLSession.isValid.

Doc from javax.net.ssl.SSLSession.isValid.

Returns whether this session is valid and available for resuming or joining.

Annotations
@Override
putValueback to summary
public void putValue(String key, Object value)

Implements javax.net.ssl.SSLSession.putValue.

Assigns a session value. Session change events are given if appropriate, to any original value as well as the new value.

Annotations
@Override
removeValueback to summary
public void removeValue(String key)

Implements javax.net.ssl.SSLSession.removeValue.

Removes the specified session value, delivering a session changed event as appropriate.

Annotations
@Override
setAsSessionResumptionback to summary
pack-priv void setAsSessionResumption(boolean flag)

Resets whether the session is re-established with a session-resumption abbreviated initial handshake.

setContextback to summary
pack-priv void setContext(SSLSessionContextImpl ctx)
setExporterMasterSecretback to summary
pack-priv void setExporterMasterSecret(SecretKey secret)
setLastAccessedTimeback to summary
pack-priv void setLastAccessedTime(long time)
setLocalCertificatesback to summary
pack-priv void setLocalCertificates(X509Certificate[] local)
setLocalPrivateKeyback to summary
pack-priv void setLocalPrivateKey(PrivateKey privateKey)
setMasterSecretback to summary
pack-priv void setMasterSecret(SecretKey secret)
setMaximumPacketSizeback to summary
pack-priv void setMaximumPacketSize(int maximumPacketSize)
setNegotiatedMaxFragSizeback to summary
pack-priv void setNegotiatedMaxFragSize(int negotiatedMaxFragLen)

Sets the negotiated maximum fragment length, as specified by the max_fragment_length ClientHello extension in RFC 6066.

Parameters
negotiatedMaxFragLen:int

the negotiated maximum fragment length, or -1 if no such length has been negotiated.

setPeerCertificatesback to summary
pack-priv void setPeerCertificates(X509Certificate[] peer)
setPeerSupportedSignatureAlgorithmsback to summary
pack-priv void setPeerSupportedSignatureAlgorithms(Collection<SignatureScheme> signatureSchemes)
setPreSharedKeyback to summary
pack-priv void setPreSharedKey(SecretKey key)
setPskIdentityback to summary
pack-priv void setPskIdentity(byte[] pskIdentity)
setRandomsback to summary
pack-priv void setRandoms(RandomCookie client, RandomCookie server)
setResumptionMasterSecretback to summary
pack-priv void setResumptionMasterSecret(SecretKey secret)
setStatusResponsesback to summary
pack-priv void setStatusResponses(List<byte[]> responses)

Provide status response data obtained during the SSL handshake.

Parameters
responses:List<byte[]>

a List of responses in binary form.

setSuiteback to summary
pack-priv void setSuite(CipherSuite suite)

Resets the cipher spec in use on this session

setTicketAgeAddback to summary
pack-priv void setTicketAgeAdd(int ticketAgeAdd)
setUseDefaultPeerSignAlgsback to summary
pack-priv void setUseDefaultPeerSignAlgs()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this SSL session

Annotations
@Override
writeback to summary
pack-priv byte[] write() throws Exception

Write out a SSLSessionImpl in a byte array for a stateless session ticket