Package org.conscrypt

Class SSLSessionImpl

java.lang.Object
org.conscrypt.SSLSessionImpl
All Implemented Interfaces:
Cloneable, SSLSession

public final class SSLSessionImpl
extends Object
implements SSLSession, Cloneable
  • Constructor Details

  • Method Details

    • getNullSession

      public static SSLSessionImpl getNullSession()
    • getApplicationBufferSize

      public int getApplicationBufferSize()
      Description copied from interface: SSLSession
      Returns the maximum size that an application buffer can be for this session.
      Specified by:
      getApplicationBufferSize in interface SSLSession
      Returns:
      the maximum application buffer size.
    • getCipherSuite

      public String getCipherSuite()
      Description copied from interface: SSLSession
      Returns the name of the cipher suite used in this session.
      Specified by:
      getCipherSuite in interface SSLSession
      Returns:
      the name of the cipher suite used in this session.
    • getCreationTime

      public long getCreationTime()
      Description copied from interface: SSLSession
      Returns the time this session was created, in milliseconds since midnight January 1st 1970 UTC.
      Specified by:
      getCreationTime in interface SSLSession
      Returns:
      the time the session was created.
    • getId

      public byte[] getId()
      Description copied from interface: SSLSession
      Returns this sessions identifier.
      Specified by:
      getId in interface SSLSession
      Returns:
      this sessions identifier.
    • getLastAccessedTime

      public long getLastAccessedTime()
      Description copied from interface: SSLSession
      Returns the time this session was last accessed, in milliseconds since midnight January 1st 1970 UTC.
      Specified by:
      getLastAccessedTime in interface SSLSession
      Returns:
      the time this session was last accessed.
    • getLocalCertificates

      public Certificate[] getLocalCertificates()
      Description copied from interface: SSLSession
      Returns the list of certificates that were used to identify the local side to the peer during the handshake.
      Specified by:
      getLocalCertificates in interface SSLSession
      Returns:
      the list of certificates, ordered from local certificate to CA's certificates.
    • getLocalPrincipal

      public Principal getLocalPrincipal()
      Description copied from interface: SSLSession
      Returns the principal used to identify the local side to the peer during the handshake.
      Specified by:
      getLocalPrincipal in interface SSLSession
      Returns:
      the principal used to identify the local side.
    • getPacketBufferSize

      public int getPacketBufferSize()
      Description copied from interface: SSLSession
      Returns the maximum size that a network buffer can be for this session.
      Specified by:
      getPacketBufferSize in interface SSLSession
      Returns:
      the maximum network buffer size.
    • getPeerCertificateChain

      public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
      Description copied from interface: SSLSession
      Returns 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:
      getPeerCertificateChain in interface SSLSession
      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: SSLSession
      Returns the list of certificates the peer used to identify itself during the handshake.
      Specified by:
      getPeerCertificates in interface SSLSession
      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: SSLSession
      Returns the host name of the peer of this session. The host name is not authenticated.
      Specified by:
      getPeerHost in interface SSLSession
      Returns:
      the host name of the peer of this session, or null if no host name is available.
    • getPeerPort

      public int getPeerPort()
      Description copied from interface: SSLSession
      Returns the port number of the peer of this session. The port number is not authenticated.
      Specified by:
      getPeerPort in interface SSLSession
      Returns:
      the port number of the peer, of -1 is no port number is available.
    • getPeerPrincipal

      public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
      Description copied from interface: SSLSession
      Returns the principal identifying the peer during the handshake.
      Specified by:
      getPeerPrincipal in interface SSLSession
      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: SSLSession
      Returns the protocol name that is used for all connections in this session.
      Specified by:
      getProtocol in interface SSLSession
      Returns:
      the protocol name that is used for all connections in this session.
    • getSessionContext

      public SSLSessionContext getSessionContext()
      Description copied from interface: SSLSession
      Returns the context of this session, or null if no context is available.
      Specified by:
      getSessionContext in interface SSLSession
    • getValue

      public Object getValue​(String name)
      Description copied from interface: SSLSession
      Returns the object bound to the specified name in this session's application layer data.
      Specified by:
      getValue in interface SSLSession
      Parameters:
      name - the name of the bound value.
      Returns:
      the value bound to the specified name, or null if the specified name does not exist or is not accessible in the current access control context.
    • getValueNames

      public String[] getValueNames()
      Description copied from interface: SSLSession
      Returns 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:
      getValueNames in interface SSLSession
      Returns:
      the list of the object names bound to this session's application layer data.
    • invalidate

      public void invalidate()
      Description copied from interface: SSLSession
      Invalidates this session.

      No new connections can be created, but any existing connection remains valid until it is closed.

      Specified by:
      invalidate in interface SSLSession
    • isValid

      public boolean isValid()
      Description copied from interface: SSLSession
      Returns whether this session is valid.
      Specified by:
      isValid in interface SSLSession
      Returns:
      true if this session is valid, otherwise false.
    • putValue

      public void putValue​(String name, Object value)
      Description copied from interface: SSLSession
      Binds the specified object under the specified name in this session's application layer data.

      For bindings (new or existing) implementing the SSLSessionBindingListener interface the object will be notified.

      Specified by:
      putValue in interface SSLSession
      Parameters:
      name - the name to bind the object to.
      value - the object to bind.
    • removeValue

      public void removeValue​(String name)
      Description copied from interface: SSLSession
      Removes the binding for the specified name in this session's application layer data. If the existing binding implements the SSLSessionBindingListener interface the object will be notified.
      Specified by:
      removeValue in interface SSLSession
      Parameters:
      name - the binding to remove.
    • clone

      public Object clone()
      Description copied from class: Object
      Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
      Overrides:
      clone in class Object
      Returns:
      a copy of this object.