Top Description Fields Constructors Methods
org.conscrypt

pack-priv Class Java7ExtendedSSLSession

extends ExtendedSSLSession
implements ConscryptSession
Class Inheritance
All Implemented Interfaces
org.conscrypt.ConscryptSession, javax.net.ssl.SSLSession
Known Direct Subclasses
org.conscrypt.Java8ExtendedSSLSession
Imports
java.security.Principal, java.security.cert.Certificate, java.util.List, javax.net.ssl.ExtendedSSLSession, .SSLPeerUnverifiedException, .SSLSessionContext, javax.security.cert.X509Certificate

This is an adapter that wraps the active session with ExtendedSSLSession, if running on Java 7+.

Field Summary

Modifier and TypeField and Description
protected final ExternalSession
private static final String[]
private static final String[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final 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 String
public final String
getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

Returns the name of the SSL cipher suite which is used for all connections in the session.
public final long
getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.
public final byte[]
getId()

Implements javax.net.ssl.SSLSession.getId.

Returns the identifier assigned to this Session.
public final long
getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

Returns the last time this Session representation was accessed by the session level infrastructure, in milliseconds since midnight, January 1, 1970 UTC.
public final Certificate[]
getLocalCertificates()

Implements javax.net.ssl.SSLSession.getLocalCertificates.

Returns the certificate(s) that were sent to the peer during handshaking.
public final Principal
getLocalPrincipal()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Returns the principal that was sent to the peer during handshaking.
public final String[]
getLocalSupportedSignatureAlgorithms()

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

Obtains an array of supported signature algorithms that the local side is willing to use.
public final int
getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Gets the current size of the largest SSL/TLS/DTLS packet that is expected when using this session.
public final X509Certificate[]
getPeerCertificateChain()

Overrides default javax.net.ssl.SSLSession.getPeerCertificateChain.

Deprecated as a consequence of X509Certificate being deprecated.
Returns the identity of the peer which was identified as part of defining the session.
public X509Certificate[]
getPeerCertificates()

Implements org.conscrypt.ConscryptSession.getPeerCertificates, javax.net.ssl.SSLSession.getPeerCertificates.

Returns the identity of the peer which was established as part of defining the session.
public final String
getPeerHost()

Implements javax.net.ssl.SSLSession.getPeerHost.

Returns the host name of the peer in this session.
public final int
getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

Returns the port number of the peer in this session.
public final Principal
getPeerPrincipal()

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Returns the identity of the peer which was established as part of defining the session.
public final byte[]
getPeerSignedCertificateTimestamp()

Implements org.conscrypt.ConscryptSession.getPeerSignedCertificateTimestamp.

Returns the signed certificate timestamp (SCT) received from the peer.
public final String[]
getPeerSupportedSignatureAlgorithms()

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

Obtains an array of supported signature algorithms that the peer is able to use.
public final String
getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol used for all connections in the session.
public final String
public final SSLSessionContext
getSessionContext()

Implements javax.net.ssl.SSLSession.getSessionContext.

Returns the context in which this session is bound.
public final List<byte[]>
public final Object
getValue(String
the name of the binding to find.
s
)

Implements javax.net.ssl.SSLSession.getValue.

Returns the object bound to the given name in the session's application layer data.
public final String[]
getValueNames()

Implements javax.net.ssl.SSLSession.getValueNames.

Returns an array of the names of all the application layer data objects bound into the Session.
public final void
invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

Invalidates the session.
public final boolean
isValid()

Implements javax.net.ssl.SSLSession.isValid.

Returns whether this session is valid and available for resuming or joining.
public final void
putValue(String
the name to which the data object will be bound. This may not be null.
s
,
Object
the data object to be bound. This may not be null.
o
)

Implements javax.net.ssl.SSLSession.putValue.

Binds the specified value object into the session's application layer data with the given name.
public final void
removeValue(String
the name of the object to remove visible across different access control contexts
s
)

Implements javax.net.ssl.SSLSession.removeValue.

Removes the object bound to the given name in the session's application layer data.
Inherited from javax.net.ssl.ExtendedSSLSession:
getRequestedServerNames

Field Detail

delegateback to summary
protected final ExternalSession delegate
LOCAL_SUPPORTED_SIGNATURE_ALGORITHMSback to summary
private static final String[] LOCAL_SUPPORTED_SIGNATURE_ALGORITHMS
PEER_SUPPORTED_SIGNATURE_ALGORITHMSback to summary
private static final String[] PEER_SUPPORTED_SIGNATURE_ALGORITHMS

Constructor Detail

Java7ExtendedSSLSessionback to summary
pack-priv Java7ExtendedSSLSession(ExternalSession delegate)

Method Detail

getApplicationBufferSizeback to summary
public final int getApplicationBufferSize()

Implements javax.net.ssl.SSLSession.getApplicationBufferSize.

Doc from javax.net.ssl.SSLSession.getApplicationBufferSize.

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

SSLEngine application data buffers must be large enough to hold the application data from any inbound network application data packet received. Typically, outbound application data buffers can be of any size.

Returns:int

the current maximum expected application packet size

Annotations
@Override
getApplicationProtocolback to summary
public String getApplicationProtocol()

Implements org.conscrypt.ConscryptSession.getApplicationProtocol.

Annotations
@Override
getCipherSuiteback to summary
public final String getCipherSuite()

Implements javax.net.ssl.SSLSession.getCipherSuite.

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

Returns:String

the name of the session's cipher suite

Annotations
@Override
getCreationTimeback to summary
public final long getCreationTime()

Implements javax.net.ssl.SSLSession.getCreationTime.

Doc from javax.net.ssl.SSLSession.getCreationTime.

Returns the time at which this Session representation was created, in milliseconds since midnight, January 1, 1970 UTC.

Returns:long

the time this Session was created

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

Implements javax.net.ssl.SSLSession.getId.

Doc from javax.net.ssl.SSLSession.getId.

Returns the identifier assigned to this Session.

Returns:byte[]

the Session identifier

Annotations
@Override
getLastAccessedTimeback to summary
public final long getLastAccessedTime()

Implements javax.net.ssl.SSLSession.getLastAccessedTime.

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

Returns:long

the last time this Session was accessed

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

Implements javax.net.ssl.SSLSession.getLocalCertificates.

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

Returns:Certificate[]

an ordered array of certificates, with the local certificate first followed by any certificate authorities. If no certificates were sent, then null is returned.

Annotations
@Override
getLocalPrincipalback to summary
public final Principal getLocalPrincipal()

Implements javax.net.ssl.SSLSession.getLocalPrincipal.

Doc from 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, and KerberosPrincipal for Kerberos cipher suites. If no principal was sent, then null is returned.

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

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

Doc from javax.net.ssl.ExtendedSSLSession.getLocalSupportedSignatureAlgorithms.

Obtains an array of supported signature algorithms that the local side is willing to use.

Note

this method is used to indicate to the peer which signature algorithms may be used for digital signatures in TLS/DTLS 1.2. It is not meaningful for TLS/DTLS versions prior to 1.2.

The signature algorithm name must be a standard Java Security name (such as "SHA1withRSA", "SHA256withECDSA", and so on). See the Java Security Standard Algorithm Names document for information about standard algorithm names.

Note

the local supported signature algorithms should conform to the algorithm constraints specified by getAlgorithmConstraints() method in SSLParameters.

Returns:String[]

An array of supported signature algorithms, in descending order of preference. The return value is an empty array if no signature algorithm is supported.

Annotations
@SuppressWarnings:MissingOverride
getPacketBufferSizeback to summary
public final int getPacketBufferSize()

Implements javax.net.ssl.SSLSession.getPacketBufferSize.

Doc from javax.net.ssl.SSLSession.getPacketBufferSize.

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

An SSLEngine using this session may generate SSL/TLS/DTLS packets of any size up to and including the value returned by this method. All SSLEngine network buffers should be sized at least this large to avoid insufficient space problems when performing wrap and unwrap calls.

Returns:int

the current maximum expected network packet size

Annotations
@Override
getPeerCertificateChainback to summary
public final X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException

Overrides default javax.net.ssl.SSLSession.getPeerCertificateChain.

Doc from javax.net.ssl.SSLSession.getPeerCertificateChain.

Deprecated

as a consequence of X509Certificate being deprecated. See corresponding docs for further information.

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 getPeerCertificates instead.

Returns:X509Certificate[]

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 certificate javax.security.cert.X509Certificate format.)

Annotations
@Override
Exceptions
SSLPeerUnverifiedException:
if the peer's identity has not been verified.
getPeerCertificatesback to summary
public X509Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException

Implements org.conscrypt.ConscryptSession.getPeerCertificates, javax.net.ssl.SSLSession.getPeerCertificates.

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

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.

Returns:X509Certificate[]

an ordered array of peer certificates, with the peer's own certificate first followed by any certificate authorities.

Annotations
@Override
Exceptions
SSLPeerUnverifiedException:
if the peer's identity has not been verified
getPeerHostback to summary
public final 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.

Returns:String

the host name of the peer host, or null if no information is available.

Annotations
@Override
getPeerPortback to summary
public final int getPeerPort()

Implements javax.net.ssl.SSLSession.getPeerPort.

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

Returns:int

the port number of the peer host, or -1 if no information is available.

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

Implements javax.net.ssl.SSLSession.getPeerPrincipal.

Doc from 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, and KerberosPrincipal for Kerberos cipher suites.

Annotations
@Override
Exceptions
SSLPeerUnverifiedException:
if the peer's identity has not been verified
getPeerSignedCertificateTimestampback to summary
public final byte[] getPeerSignedCertificateTimestamp()

Implements org.conscrypt.ConscryptSession.getPeerSignedCertificateTimestamp.

Doc from org.conscrypt.ConscryptSession.getPeerSignedCertificateTimestamp.

Returns the signed certificate timestamp (SCT) received from the peer. Returns a copy of the internal array.

Annotations
@Override
getPeerSupportedSignatureAlgorithmsback to summary
public final String[] getPeerSupportedSignatureAlgorithms()

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

Doc from javax.net.ssl.ExtendedSSLSession.getPeerSupportedSignatureAlgorithms.

Obtains an array of supported signature algorithms that the peer is able to use.

Note

this method is used to indicate to the local side which signature algorithms may be used for digital signatures in TLS/DTLS 1.2. It is not meaningful for TLS/DTLS versions prior to 1.2.

The signature algorithm name must be a standard Java Security name (such as "SHA1withRSA", "SHA256withECDSA", and so on). See the Java Security Standard Algorithm Names document for information about standard algorithm names.

Returns:String[]

An array of supported signature algorithms, in descending order of preference. The return value is an empty array if the peer has not sent the supported signature algorithms.

Annotations
@SuppressWarnings:MissingOverride
getProtocolback to summary
public final String getProtocol()

Implements javax.net.ssl.SSLSession.getProtocol.

Doc from javax.net.ssl.SSLSession.getProtocol.

Returns the standard name of the protocol used for all connections in the session.

This defines the protocol used in the connection.

Returns:String

the standard name of the protocol used for all connections in the session.

Annotations
@Override
getRequestedServerNameback to summary
public final String getRequestedServerName()

Implements org.conscrypt.ConscryptSession.getRequestedServerName.

Annotations
@Override
getSessionContextback to summary
public final SSLSessionContext getSessionContext()

Implements javax.net.ssl.SSLSession.getSessionContext.

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

If the context is available and there is a security manager installed, the caller may require permission to access it or a security exception may be thrown. In a Java environment, the security manager's checkPermission method is called with a SSLPermission("getSSLSessionContext") permission.

Returns:SSLSessionContext

the session context used for this session, or null if the context is unavailable.

Annotations
@Override
getStatusResponsesback to summary
public final List<byte[]> getStatusResponses()

Overrides javax.net.ssl.ExtendedSSLSession.getStatusResponses.

Implements org.conscrypt.ConscryptSession.getStatusResponses.

Provides forward-compatibility with Java 9.

Returns:List<byte[]>

Doc from javax.net.ssl.ExtendedSSLSession.getStatusResponses.

a non-null unmodifiable list of byte arrays, each entry containing a DER-encoded OCSP response (using the ASN.1 type OCSPResponse defined in RFC 6960). The order of the responses must match the order of the certificates presented by the server in its Certificate message (See SSLSession#getLocalCertificates() for server mode, and SSLSession#getPeerCertificates() for client mode). It is possible that fewer response entries may be returned than the number of presented certificates. If an entry in the list is a zero-length byte array, it should be treated by the caller as if the OCSP entry for the corresponding certificate is missing. The returned list may be empty if no OCSP responses were presented during handshaking or if OCSP stapling is not supported by either endpoint for this handshake.

Annotations
@Override
getValueback to summary
public final Object getValue(String s)

Implements javax.net.ssl.SSLSession.getValue.

Doc from javax.net.ssl.SSLSession.getValue.

Returns the object bound to the given name in the session's application layer data. Returns null if there is no such binding.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
s:String

the name of the binding to find.

Returns:Object

the value bound to that name, or null if the binding does not exist.

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

Implements javax.net.ssl.SSLSession.getValueNames.

Doc from javax.net.ssl.SSLSession.getValueNames.

Returns an array of the names of all the application layer data objects bound into the Session.

For security reasons, the same named values may not be visible across different access control contexts.

Returns:String[]

a non-null (possibly empty) array of names of the objects bound to this Session.

Annotations
@Override
invalidateback to summary
public final void invalidate()

Implements javax.net.ssl.SSLSession.invalidate.

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

Annotations
@Override
isValidback to summary
public final 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.

Returns:boolean

true if this session may be rejoined.

Annotations
@Override
putValueback to summary
public final void putValue(String s, Object o)

Implements javax.net.ssl.SSLSession.putValue.

Doc from javax.net.ssl.SSLSession.putValue.

Binds the specified value object into the session's application layer data with the given name.

Any existing binding using the same name is replaced. If the new (or existing) value implements the SSLSessionBindingListener interface, the object represented by value is notified appropriately.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
s:String

the name to which the data object will be bound. This may not be null.

o:Object

the data object to be bound. This may not be null.

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

Implements javax.net.ssl.SSLSession.removeValue.

Doc from javax.net.ssl.SSLSession.removeValue.

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 SSLSessionBindingListener interface, it is notified appropriately.

For security reasons, the same named values may not be visible across different access control contexts.

Parameters
s:String

the name of the object to remove visible across different access control contexts

Annotations
@Override