Package org.conscrypt

Class NativeSsl


  • final class NativeSsl
    extends java.lang.Object
    A utility wrapper that abstracts operations on the underlying native SSL instance.
    • Method Detail

      • offerToResumeSession

        void offerToResumeSession​(long sslSessionNativePointer)
                           throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • getSessionId

        byte[] getSessionId()
      • getTime

        long getTime()
      • getTimeout

        long getTimeout()
      • setTimeout

        void setTimeout​(long millis)
      • getCipherSuite

        java.lang.String getCipherSuite()
      • getPeerCertificates

        java.security.cert.X509Certificate[] getPeerCertificates()
                                                          throws java.security.cert.CertificateException
        Throws:
        java.security.cert.CertificateException
      • getLocalCertificates

        java.security.cert.X509Certificate[] getLocalCertificates()
      • getPeerCertificateOcspData

        byte[] getPeerCertificateOcspData()
      • getTlsUnique

        byte[] getTlsUnique()
      • exportKeyingMaterial

        byte[] exportKeyingMaterial​(java.lang.String label,
                                    byte[] context,
                                    int length)
                             throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • getPeerTlsSctData

        byte[] getPeerTlsSctData()
      • chooseClientCertificate

        void chooseClientCertificate​(byte[] keyTypeBytes,
                                     int[] signatureAlgs,
                                     byte[][] asn1DerEncodedPrincipals)
                              throws javax.net.ssl.SSLException,
                                     java.security.cert.CertificateEncodingException
        Throws:
        javax.net.ssl.SSLException
        java.security.cert.CertificateEncodingException
      • setCertificate

        private void setCertificate​(java.lang.String alias)
                             throws java.security.cert.CertificateEncodingException,
                                    javax.net.ssl.SSLException
        Throws:
        java.security.cert.CertificateEncodingException
        javax.net.ssl.SSLException
      • getVersion

        java.lang.String getVersion()
      • getRequestedServerName

        java.lang.String getRequestedServerName()
      • getTlsChannelId

        byte[] getTlsChannelId()
                        throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • initialize

        void initialize​(java.lang.String hostname,
                        OpenSSLKey channelIdPrivateKey)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • configureServerCertificate

        void configureServerCertificate()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • verifyWithSniMatchers

        private void verifyWithSniMatchers​(java.lang.String serverName)
                                    throws javax.net.ssl.SSLHandshakeException
        Throws:
        javax.net.ssl.SSLHandshakeException
      • getCipherKeyTypes

        private java.util.Set<java.lang.String> getCipherKeyTypes()
      • doHandshake

        void doHandshake​(java.io.FileDescriptor fd,
                         int timeoutMillis)
                  throws java.security.cert.CertificateException,
                         java.io.IOException
        Throws:
        java.security.cert.CertificateException
        java.io.IOException
      • doHandshake

        int doHandshake()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        int read​(java.io.FileDescriptor fd,
                 byte[] buf,
                 int offset,
                 int len,
                 int timeoutMillis)
          throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        void write​(java.io.FileDescriptor fd,
                   byte[] buf,
                   int offset,
                   int len,
                   int timeoutMillis)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • enablePSKKeyManagerIfRequested

        private void enablePSKKeyManagerIfRequested()
                                             throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • setTlsChannelId

        private void setTlsChannelId​(OpenSSLKey channelIdPrivateKey)
                              throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • setCertificateValidation

        private void setCertificateValidation()
                                       throws javax.net.ssl.SSLException
        Throws:
        javax.net.ssl.SSLException
      • interrupt

        void interrupt()
      • shutdown

        void shutdown​(java.io.FileDescriptor fd)
               throws java.io.IOException
        Throws:
        java.io.IOException
      • shutdown

        void shutdown()
               throws java.io.IOException
        Throws:
        java.io.IOException
      • wasShutdownReceived

        boolean wasShutdownReceived()
      • wasShutdownSent

        boolean wasShutdownSent()
      • readDirectByteBuffer

        int readDirectByteBuffer​(long destAddress,
                                 int destLength)
                          throws java.io.IOException,
                                 java.security.cert.CertificateException
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
      • writeDirectByteBuffer

        int writeDirectByteBuffer​(long sourceAddress,
                                  int sourceLength)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • forceRead

        void forceRead()
                throws java.io.IOException
        Throws:
        java.io.IOException
      • getPendingReadableBytes

        int getPendingReadableBytes()
      • getMaxSealOverhead

        int getMaxSealOverhead()
      • close

        void close()
      • isClosed

        boolean isClosed()
      • getError

        int getError​(int result)
      • getApplicationProtocol

        byte[] getApplicationProtocol()
      • isClient

        private boolean isClient()
      • finalize

        protected final void finalize()
                               throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable