Package org.conscrypt
Class SSLNullSession
- java.lang.Object
-
- org.conscrypt.SSLNullSession
-
- All Implemented Interfaces:
Cloneable,SSLSession
public final class SSLNullSession extends Object implements SSLSession, Cloneable
-
-
Constructor Summary
Constructors Constructor Description SSLNullSession()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetApplicationBufferSize()Returns the maximum size that an application buffer can be for this session.StringgetCipherSuite()Returns the name of the cipher suite used in this session.longgetCreationTime()Returns the time this session was created, in milliseconds since midnight January 1st 1970 UTC.byte[]getId()Returns this sessions identifier.longgetLastAccessedTime()Returns the time this session was last accessed, in milliseconds since midnight January 1st 1970 UTC.Certificate[]getLocalCertificates()Returns the list of certificates that were used to identify the local side to the peer during the handshake.PrincipalgetLocalPrincipal()Returns the principal used to identify the local side to the peer during the handshake.static SSLSessiongetNullSession()intgetPacketBufferSize()Returns the maximum size that a network buffer can be for this session.X509Certificate[]getPeerCertificateChain()Returns the list of certificates the peer used to identify itself during the handshake.Certificate[]getPeerCertificates()Returns the list of certificates the peer used to identify itself during the handshake.StringgetPeerHost()Returns the host name of the peer of this session.intgetPeerPort()Returns the port number of the peer of this session.PrincipalgetPeerPrincipal()Returns the principal identifying the peer during the handshake.StringgetProtocol()Returns the protocol name that is used for all connections in this session.SSLSessionContextgetSessionContext()Returns the context of this session, or null if no context is available.ObjectgetValue(String name)Returns the object bound to the specified name in this session's application layer data.String[]getValueNames()Returns the list of the object names bound to this session's application layer data..voidinvalidate()Invalidates this session.booleanisValid()Returns whether this session is valid.voidputValue(String name, Object value)Binds the specified object under the specified name in this session's application layer data.voidremoveValue(String name)Removes the binding for the specified name in this session's application layer data.
-
-
-
Method Detail
-
getNullSession
public static SSLSession getNullSession()
-
getApplicationBufferSize
public int getApplicationBufferSize()
Description copied from interface:SSLSessionReturns the maximum size that an application buffer can be for this session.- Specified by:
getApplicationBufferSizein interfaceSSLSession- Returns:
- the maximum application buffer size.
-
getCipherSuite
public String getCipherSuite()
Description copied from interface:SSLSessionReturns the name of the cipher suite used in this session.- Specified by:
getCipherSuitein interfaceSSLSession- Returns:
- the name of the cipher suite used in this session.
-
getCreationTime
public long getCreationTime()
Description copied from interface:SSLSessionReturns the time this session was created, in milliseconds since midnight January 1st 1970 UTC.- Specified by:
getCreationTimein interfaceSSLSession- Returns:
- the time the session was created.
-
getId
public byte[] getId()
Description copied from interface:SSLSessionReturns this sessions identifier.- Specified by:
getIdin interfaceSSLSession- Returns:
- this sessions identifier.
-
getLastAccessedTime
public long getLastAccessedTime()
Description copied from interface:SSLSessionReturns the time this session was last accessed, in milliseconds since midnight January 1st 1970 UTC.- Specified by:
getLastAccessedTimein interfaceSSLSession- Returns:
- the time this session was last accessed.
-
getLocalCertificates
public Certificate[] getLocalCertificates()
Description copied from interface:SSLSessionReturns the list of certificates that were used to identify the local side to the peer during the handshake.- Specified by:
getLocalCertificatesin interfaceSSLSession- Returns:
- the list of certificates, ordered from local certificate to CA's certificates.
-
getLocalPrincipal
public Principal getLocalPrincipal()
Description copied from interface:SSLSessionReturns the principal used to identify the local side to the peer during the handshake.- Specified by:
getLocalPrincipalin interfaceSSLSession- Returns:
- the principal used to identify the local side.
-
getPacketBufferSize
public int getPacketBufferSize()
Description copied from interface:SSLSessionReturns the maximum size that a network buffer can be for this session.- Specified by:
getPacketBufferSizein interfaceSSLSession- Returns:
- the maximum network buffer size.
-
getPeerCertificateChain
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
Description copied from interface:SSLSessionReturns the list of certificates the peer used to identify itself during the handshake.Note: this method exists for compatility reasons, use
SSLSession.getPeerCertificates()instead.- Specified by:
getPeerCertificateChainin interfaceSSLSession- Returns:
- the list of certificates, ordered from the identity certificate to the CA's certificates
- Throws:
SSLPeerUnverifiedException- if the identity of the peer is not verified.
-
getPeerCertificates
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
Description copied from interface:SSLSessionReturns the list of certificates the peer used to identify itself during the handshake.- Specified by:
getPeerCertificatesin interfaceSSLSession- Returns:
- the list of certificates, ordered from the identity certificate to the CA's certificates.
- Throws:
SSLPeerUnverifiedException- if the identity of the peer is not verified.
-
getPeerHost
public String getPeerHost()
Description copied from interface:SSLSessionReturns the host name of the peer of this session. The host name is not authenticated.- Specified by:
getPeerHostin interfaceSSLSession- Returns:
- the host name of the peer of this session, or
nullif no host name is available.
-
getPeerPort
public int getPeerPort()
Description copied from interface:SSLSessionReturns the port number of the peer of this session. The port number is not authenticated.- Specified by:
getPeerPortin interfaceSSLSession- Returns:
- the port number of the peer, of
-1is no port number is available.
-
getPeerPrincipal
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
Description copied from interface:SSLSessionReturns the principal identifying the peer during the handshake.- Specified by:
getPeerPrincipalin interfaceSSLSession- Returns:
- the principal identifying the peer.
- Throws:
SSLPeerUnverifiedException- if the identity of the peer has not been verified.
-
getProtocol
public String getProtocol()
Description copied from interface:SSLSessionReturns the protocol name that is used for all connections in this session.- Specified by:
getProtocolin interfaceSSLSession- Returns:
- the protocol name that is used for all connections in this session.
-
getSessionContext
public SSLSessionContext getSessionContext()
Description copied from interface:SSLSessionReturns the context of this session, or null if no context is available.- Specified by:
getSessionContextin interfaceSSLSession
-
getValue
public Object getValue(String name)
Description copied from interface:SSLSessionReturns the object bound to the specified name in this session's application layer data.- Specified by:
getValuein interfaceSSLSession- Parameters:
name- the name of the bound value.- Returns:
- the value bound to the specified name, or
nullif the specified name does not exist or is not accessible in the current access control context.
-
getValueNames
public String[] getValueNames()
Description copied from interface:SSLSessionReturns the list of the object names bound to this session's application layer data..Depending on the current access control context, the list of object names may be different.
- Specified by:
getValueNamesin interfaceSSLSession- Returns:
- the list of the object names bound to this session's application layer data.
-
invalidate
public void invalidate()
Description copied from interface:SSLSessionInvalidates this session.No new connections can be created, but any existing connection remains valid until it is closed.
- Specified by:
invalidatein interfaceSSLSession
-
isValid
public boolean isValid()
Description copied from interface:SSLSessionReturns whether this session is valid.- Specified by:
isValidin interfaceSSLSession- Returns:
trueif this session is valid, otherwisefalse.
-
putValue
public void putValue(String name, Object value)
Description copied from interface:SSLSessionBinds the specified object under the specified name in this session's application layer data.For bindings (new or existing) implementing the
SSLSessionBindingListenerinterface the object will be notified.- Specified by:
putValuein interfaceSSLSession- Parameters:
name- the name to bind the object to.value- the object to bind.
-
removeValue
public void removeValue(String name)
Description copied from interface:SSLSessionRemoves the binding for the specified name in this session's application layer data. If the existing binding implements theSSLSessionBindingListenerinterface the object will be notified.- Specified by:
removeValuein interfaceSSLSession- Parameters:
name- the binding to remove.
-
-