Package org.conscrypt
Class ExternalSession
java.lang.Object
org.conscrypt.ExternalSession
- All Implemented Interfaces:
SSLSession
,ConscryptSession
An externalized view of the underlying
SSLSession
used within a
socket/engine. This class provides the caller with a consistent session
handle which will continue to be usable regardless of internal changes
to the connection. It does this by delegating calls to the current
internal session, which is provided by the session Provider
(i.e. the socket or engine that owns the session). This allows the provider
to switch implementations (for instance, using a JNI implementation to
access live values while the connection is open and a set of final values
when the connection is closed), even if the caller stores a reference to
the session object.
This class implements the SSLSession
value API itself, rather
than delegating to the provided session, to ensure the caller has a consistent
value map, regardless of which internal session is currently being used by the
socket/engine. This class will never call the value API methods on the
underlying sessions, so they need not be implemented.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
The provider of the current delegate session. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
long
byte[]
getId()
long
int
int
byte[]
Returns the signed certificate timestamp (SCT) received from the peer.List
<byte[]> Returns the OCSP stapled response.String[]
void
boolean
isValid()
void
(package private) void
putValue
(SSLSession session, String name, Object value) void
removeValue
(String name) (package private) void
removeValue
(SSLSession session, String name)
-
Field Details
-
values
-
provider
-
-
Constructor Details
-
ExternalSession
-
-
Method Details
-
getRequestedServerName
- Specified by:
getRequestedServerName
in interfaceConscryptSession
-
getStatusResponses
Description copied from interface:ConscryptSession
Returns the OCSP stapled response. Returns a copy of the internal arrays. The method signature matches Java 9.- Specified by:
getStatusResponses
in interfaceConscryptSession
- See Also:
-
getPeerSignedCertificateTimestamp
public byte[] getPeerSignedCertificateTimestamp()Description copied from interface:ConscryptSession
Returns the signed certificate timestamp (SCT) received from the peer. Returns a copy of the internal array.- Specified by:
getPeerSignedCertificateTimestamp
in interfaceConscryptSession
- See Also:
-
getId
public byte[] getId()- Specified by:
getId
in interfaceSSLSession
-
getSessionContext
- Specified by:
getSessionContext
in interfaceSSLSession
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in interfaceSSLSession
-
getLastAccessedTime
public long getLastAccessedTime()- Specified by:
getLastAccessedTime
in interfaceSSLSession
-
invalidate
public void invalidate()- Specified by:
invalidate
in interfaceSSLSession
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceSSLSession
-
getPeerCertificates
- Specified by:
getPeerCertificates
in interfaceConscryptSession
- Specified by:
getPeerCertificates
in interfaceSSLSession
- Throws:
SSLPeerUnverifiedException
-
getLocalCertificates
- Specified by:
getLocalCertificates
in interfaceSSLSession
-
getPeerCertificateChain
- Specified by:
getPeerCertificateChain
in interfaceSSLSession
- Throws:
SSLPeerUnverifiedException
-
getPeerPrincipal
- Specified by:
getPeerPrincipal
in interfaceSSLSession
- Throws:
SSLPeerUnverifiedException
-
getLocalPrincipal
- Specified by:
getLocalPrincipal
in interfaceSSLSession
-
getCipherSuite
- Specified by:
getCipherSuite
in interfaceSSLSession
-
getProtocol
- Specified by:
getProtocol
in interfaceSSLSession
-
getPeerHost
- Specified by:
getPeerHost
in interfaceSSLSession
-
getPeerPort
public int getPeerPort()- Specified by:
getPeerPort
in interfaceSSLSession
-
getPacketBufferSize
public int getPacketBufferSize()- Specified by:
getPacketBufferSize
in interfaceSSLSession
-
getApplicationBufferSize
public int getApplicationBufferSize()- Specified by:
getApplicationBufferSize
in interfaceSSLSession
-
getApplicationProtocol
- Specified by:
getApplicationProtocol
in interfaceConscryptSession
-
getValue
- Specified by:
getValue
in interfaceSSLSession
-
getValueNames
- Specified by:
getValueNames
in interfaceSSLSession
-
putValue
- Specified by:
putValue
in interfaceSSLSession
-
putValue
-
removeValue
- Specified by:
removeValue
in interfaceSSLSession
-
removeValue
-