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 interfaceThe provider of the current delegate session. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongbyte[]getId()longintintbyte[]Returns the signed certificate timestamp (SCT) received from the peer.List<byte[]> Returns the OCSP stapled response.String[]voidbooleanisValid()void(package private) voidputValue(SSLSession session, String name, Object value) voidremoveValue(String name) (package private) voidremoveValue(SSLSession session, String name)
-
Field Details
-
values
-
provider
-
-
Constructor Details
-
ExternalSession
-
-
Method Details
-
getRequestedServerName
- Specified by:
getRequestedServerNamein interfaceConscryptSession
-
getStatusResponses
Description copied from interface:ConscryptSessionReturns the OCSP stapled response. Returns a copy of the internal arrays. The method signature matches Java 9.- Specified by:
getStatusResponsesin interfaceConscryptSession- See Also:
-
getPeerSignedCertificateTimestamp
public byte[] getPeerSignedCertificateTimestamp()Description copied from interface:ConscryptSessionReturns the signed certificate timestamp (SCT) received from the peer. Returns a copy of the internal array.- Specified by:
getPeerSignedCertificateTimestampin interfaceConscryptSession- See Also:
-
getId
public byte[] getId()- Specified by:
getIdin interfaceSSLSession
-
getSessionContext
- Specified by:
getSessionContextin interfaceSSLSession
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceSSLSession
-
getLastAccessedTime
public long getLastAccessedTime()- Specified by:
getLastAccessedTimein interfaceSSLSession
-
invalidate
public void invalidate()- Specified by:
invalidatein interfaceSSLSession
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceSSLSession
-
getPeerCertificates
- Specified by:
getPeerCertificatesin interfaceConscryptSession- Specified by:
getPeerCertificatesin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getLocalCertificates
- Specified by:
getLocalCertificatesin interfaceSSLSession
-
getPeerCertificateChain
- Specified by:
getPeerCertificateChainin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getPeerPrincipal
- Specified by:
getPeerPrincipalin interfaceSSLSession- Throws:
SSLPeerUnverifiedException
-
getLocalPrincipal
- Specified by:
getLocalPrincipalin interfaceSSLSession
-
getCipherSuite
- Specified by:
getCipherSuitein interfaceSSLSession
-
getProtocol
- Specified by:
getProtocolin interfaceSSLSession
-
getPeerHost
- Specified by:
getPeerHostin interfaceSSLSession
-
getPeerPort
public int getPeerPort()- Specified by:
getPeerPortin interfaceSSLSession
-
getPacketBufferSize
public int getPacketBufferSize()- Specified by:
getPacketBufferSizein interfaceSSLSession
-
getApplicationBufferSize
public int getApplicationBufferSize()- Specified by:
getApplicationBufferSizein interfaceSSLSession
-
getApplicationProtocol
- Specified by:
getApplicationProtocolin interfaceConscryptSession
-
getValue
- Specified by:
getValuein interfaceSSLSession
-
getValueNames
- Specified by:
getValueNamesin interfaceSSLSession
-
putValue
- Specified by:
putValuein interfaceSSLSession
-
putValue
-
removeValue
- Specified by:
removeValuein interfaceSSLSession
-
removeValue
-