Class ReferenceCountedOpenSslEngine.DefaultOpenSslSession

    • Field Detail

      • x509PeerCerts

        private javax.security.cert.X509Certificate[] x509PeerCerts
      • peerCerts

        private java.security.cert.Certificate[] peerCerts
      • valid

        private boolean valid
      • protocol

        private java.lang.String protocol
      • cipher

        private java.lang.String cipher
      • creationTime

        private long creationTime
      • lastAccessed

        private long lastAccessed
      • applicationBufferSize

        private volatile int applicationBufferSize
      • localCertificateChain

        private volatile java.security.cert.Certificate[] localCertificateChain
      • keyValueStorage

        private volatile java.util.Map<java.lang.String,​java.lang.Object> keyValueStorage
    • Method Detail

      • newSSLSessionBindingEvent

        private javax.net.ssl.SSLSessionBindingEvent newSSLSessionBindingEvent​(java.lang.String name)
      • prepareHandshake

        public void prepareHandshake()
        Description copied from interface: OpenSslSession
        Called on a handshake session before being exposed to a TrustManager. Session data must be cleared by this call.
        Specified by:
        prepareHandshake in interface OpenSslSession
      • setSessionDetails

        public void setSessionDetails​(long creationTime,
                                      long lastAccessedTime,
                                      OpenSslSessionId sessionId,
                                      java.util.Map<java.lang.String,​java.lang.Object> keyValueStorage)
        Description copied from interface: OpenSslSession
        Set the details for the session which might come from a cache.
        Specified by:
        setSessionDetails in interface OpenSslSession
        Parameters:
        creationTime - the time at which the session was created.
        lastAccessedTime - the time at which the session was last accessed via the session infrastructure (cache).
        sessionId - the OpenSslSessionId
        keyValueStorage - the key value store. See OpenSslSession.keyValueStorage().
      • keyValueStorage

        public java.util.Map<java.lang.String,​java.lang.Object> keyValueStorage()
        Description copied from interface: OpenSslSession
        Return the underlying Map that is used by the following methods:
        • SSLSession.putValue(String, Object)
        • SSLSession.removeValue(String)
        • SSLSession.getValue(String)
        • SSLSession.getValueNames()
        The Map must be thread-safe!
        Specified by:
        keyValueStorage in interface OpenSslSession
        Returns:
        storage
      • setLocalCertificate

        public void setLocalCertificate​(java.security.cert.Certificate[] localCertificate)
        Description copied from interface: OpenSslSession
        Set the local certificate chain that is used. It is not expected that this array will be changed at all and so its ok to not copy the array.
        Specified by:
        setLocalCertificate in interface OpenSslSession
      • getId

        public byte[] getId()
        Specified by:
        getId in interface javax.net.ssl.SSLSession
      • getCreationTime

        public long getCreationTime()
        Specified by:
        getCreationTime in interface javax.net.ssl.SSLSession
      • setLastAccessedTime

        public void setLastAccessedTime​(long time)
        Description copied from interface: OpenSslSession
        Set the last access time which will be returned by SSLSession.getLastAccessedTime().
        Specified by:
        setLastAccessedTime in interface OpenSslSession
        Parameters:
        time - the time
      • getLastAccessedTime

        public long getLastAccessedTime()
        Specified by:
        getLastAccessedTime in interface javax.net.ssl.SSLSession
      • invalidate

        public void invalidate()
        Specified by:
        invalidate in interface javax.net.ssl.SSLSession
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface javax.net.ssl.SSLSession
      • putValue

        public void putValue​(java.lang.String name,
                             java.lang.Object value)
        Specified by:
        putValue in interface javax.net.ssl.SSLSession
      • getValue

        public java.lang.Object getValue​(java.lang.String name)
        Specified by:
        getValue in interface javax.net.ssl.SSLSession
      • removeValue

        public void removeValue​(java.lang.String name)
        Specified by:
        removeValue in interface javax.net.ssl.SSLSession
      • getValueNames

        public java.lang.String[] getValueNames()
        Specified by:
        getValueNames in interface javax.net.ssl.SSLSession
      • notifyUnbound

        private void notifyUnbound​(java.lang.Object value,
                                   java.lang.String name)
      • handshakeFinished

        public void handshakeFinished​(byte[] id,
                                      java.lang.String cipher,
                                      java.lang.String protocol,
                                      byte[] peerCertificate,
                                      byte[][] peerCertificateChain,
                                      long creationTime,
                                      long timeout)
                               throws javax.net.ssl.SSLException
        Finish the handshake and so init everything in the OpenSslSession that should be accessible by the user.
        Specified by:
        handshakeFinished in interface OpenSslSession
        Throws:
        javax.net.ssl.SSLException
      • initCerts

        private void initCerts​(byte[][] chain,
                               int startPos)
      • getPeerCertificates

        public java.security.cert.Certificate[] getPeerCertificates()
                                                             throws javax.net.ssl.SSLPeerUnverifiedException
        Specified by:
        getPeerCertificates in interface javax.net.ssl.SSLSession
        Throws:
        javax.net.ssl.SSLPeerUnverifiedException
      • getLocalCertificates

        public java.security.cert.Certificate[] getLocalCertificates()
        Specified by:
        getLocalCertificates in interface javax.net.ssl.SSLSession
      • getPeerCertificateChain

        public javax.security.cert.X509Certificate[] getPeerCertificateChain()
                                                                      throws javax.net.ssl.SSLPeerUnverifiedException
        Specified by:
        getPeerCertificateChain in interface javax.net.ssl.SSLSession
        Throws:
        javax.net.ssl.SSLPeerUnverifiedException
      • getPeerPrincipal

        public java.security.Principal getPeerPrincipal()
                                                 throws javax.net.ssl.SSLPeerUnverifiedException
        Specified by:
        getPeerPrincipal in interface javax.net.ssl.SSLSession
        Throws:
        javax.net.ssl.SSLPeerUnverifiedException
      • getLocalPrincipal

        public java.security.Principal getLocalPrincipal()
        Specified by:
        getLocalPrincipal in interface javax.net.ssl.SSLSession
      • getCipherSuite

        public java.lang.String getCipherSuite()
        Specified by:
        getCipherSuite in interface javax.net.ssl.SSLSession
      • getProtocol

        public java.lang.String getProtocol()
        Specified by:
        getProtocol in interface javax.net.ssl.SSLSession
      • getPeerHost

        public java.lang.String getPeerHost()
        Specified by:
        getPeerHost in interface javax.net.ssl.SSLSession
      • getPeerPort

        public int getPeerPort()
        Specified by:
        getPeerPort in interface javax.net.ssl.SSLSession
      • getPacketBufferSize

        public int getPacketBufferSize()
        Specified by:
        getPacketBufferSize in interface javax.net.ssl.SSLSession
      • getApplicationBufferSize

        public int getApplicationBufferSize()
        Specified by:
        getApplicationBufferSize in interface javax.net.ssl.SSLSession
      • tryExpandApplicationBufferSize

        public void tryExpandApplicationBufferSize​(int packetLengthDataOnly)
        Description copied from interface: OpenSslSession
        Expand (or increase) the value returned by SSLSession.getApplicationBufferSize() if necessary.

        This is only called in a synchronized block, so no need to use atomic operations.

        Specified by:
        tryExpandApplicationBufferSize in interface OpenSslSession
        Parameters:
        packetLengthDataOnly - The packet size which exceeds the current SSLSession.getApplicationBufferSize().
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object