Class WolfSSLEngine


  • public class WolfSSLEngine
    extends javax.net.ssl.SSLEngine
    wolfSSL implementation of SSLEngine
    Author:
    wolfSSL
    • Constructor Detail

      • WolfSSLEngine

        protected WolfSSLEngine​(WolfSSLContext ctx,
                                WolfSSLAuthStore auth,
                                com.wolfssl.provider.jsse.WolfSSLParameters params)
                         throws WolfSSLException
        Create a new engine with no hints for session reuse
        Parameters:
        ctx - JNI level WolfSSLContext
        auth - WolfSSLAuthStore to use
        params - connection parameters to be used
        Throws:
        WolfSSLException - if there is an issue creating the engine
      • WolfSSLEngine

        protected WolfSSLEngine​(WolfSSLContext ctx,
                                WolfSSLAuthStore auth,
                                com.wolfssl.provider.jsse.WolfSSLParameters params,
                                java.lang.String host,
                                int port)
                         throws WolfSSLException
        Create a new engine with hints for session reuse
        Parameters:
        ctx - JNI level WolfSSLContext
        auth - WolfSSLAuthStore to use
        params - connection parameters to be used
        host - to connect to
        port - to connect to
        Throws:
        WolfSSLException - if there is an issue creating the engine
    • Method Detail

      • wrap

        public javax.net.ssl.SSLEngineResult wrap​(java.nio.ByteBuffer in,
                                                  java.nio.ByteBuffer out)
                                           throws javax.net.ssl.SSLException
        Overrides:
        wrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • wrap

        public javax.net.ssl.SSLEngineResult wrap​(java.nio.ByteBuffer[] in,
                                                  int ofst,
                                                  int len,
                                                  java.nio.ByteBuffer out)
                                           throws javax.net.ssl.SSLException
        Specified by:
        wrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer in,
                                                    java.nio.ByteBuffer out)
                                             throws javax.net.ssl.SSLException
        Overrides:
        unwrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • unwrap

        public javax.net.ssl.SSLEngineResult unwrap​(java.nio.ByteBuffer in,
                                                    java.nio.ByteBuffer[] out,
                                                    int ofst,
                                                    int length)
                                             throws javax.net.ssl.SSLException
        Specified by:
        unwrap in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • getDelegatedTask

        public java.lang.Runnable getDelegatedTask()
        Specified by:
        getDelegatedTask in class javax.net.ssl.SSLEngine
      • closeInbound

        public void closeInbound()
                          throws javax.net.ssl.SSLException
        Specified by:
        closeInbound in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • isInboundDone

        public boolean isInboundDone()
        Specified by:
        isInboundDone in class javax.net.ssl.SSLEngine
      • closeOutbound

        public void closeOutbound()
        Specified by:
        closeOutbound in class javax.net.ssl.SSLEngine
      • isOutboundDone

        public boolean isOutboundDone()
        Specified by:
        isOutboundDone in class javax.net.ssl.SSLEngine
      • getSupportedCipherSuites

        public java.lang.String[] getSupportedCipherSuites()
        Specified by:
        getSupportedCipherSuites in class javax.net.ssl.SSLEngine
      • getEnabledCipherSuites

        public java.lang.String[] getEnabledCipherSuites()
        Specified by:
        getEnabledCipherSuites in class javax.net.ssl.SSLEngine
      • setEnabledCipherSuites

        public void setEnabledCipherSuites​(java.lang.String[] suites)
        Specified by:
        setEnabledCipherSuites in class javax.net.ssl.SSLEngine
      • getSupportedProtocols

        public java.lang.String[] getSupportedProtocols()
        Specified by:
        getSupportedProtocols in class javax.net.ssl.SSLEngine
      • getEnabledProtocols

        public java.lang.String[] getEnabledProtocols()
        Specified by:
        getEnabledProtocols in class javax.net.ssl.SSLEngine
      • setEnabledProtocols

        public void setEnabledProtocols​(java.lang.String[] protocols)
        Specified by:
        setEnabledProtocols in class javax.net.ssl.SSLEngine
      • getSession

        public javax.net.ssl.SSLSession getSession()
        Specified by:
        getSession in class javax.net.ssl.SSLEngine
      • beginHandshake

        public void beginHandshake()
                            throws javax.net.ssl.SSLException
        Specified by:
        beginHandshake in class javax.net.ssl.SSLEngine
        Throws:
        javax.net.ssl.SSLException
      • getHandshakeStatus

        public javax.net.ssl.SSLEngineResult.HandshakeStatus getHandshakeStatus()
        Specified by:
        getHandshakeStatus in class javax.net.ssl.SSLEngine
      • setUseClientMode

        public void setUseClientMode​(boolean mode)
        Specified by:
        setUseClientMode in class javax.net.ssl.SSLEngine
      • getUseClientMode

        public boolean getUseClientMode()
        Specified by:
        getUseClientMode in class javax.net.ssl.SSLEngine
      • setNeedClientAuth

        public void setNeedClientAuth​(boolean need)
        Specified by:
        setNeedClientAuth in class javax.net.ssl.SSLEngine
      • getNeedClientAuth

        public boolean getNeedClientAuth()
        Specified by:
        getNeedClientAuth in class javax.net.ssl.SSLEngine
      • setWantClientAuth

        public void setWantClientAuth​(boolean want)
        Specified by:
        setWantClientAuth in class javax.net.ssl.SSLEngine
      • getWantClientAuth

        public boolean getWantClientAuth()
        Specified by:
        getWantClientAuth in class javax.net.ssl.SSLEngine
      • setEnableSessionCreation

        public void setEnableSessionCreation​(boolean flag)
        Specified by:
        setEnableSessionCreation in class javax.net.ssl.SSLEngine
      • getEnableSessionCreation

        public boolean getEnableSessionCreation()
        Specified by:
        getEnableSessionCreation in class javax.net.ssl.SSLEngine
      • setSSLParameters

        public void setSSLParameters​(javax.net.ssl.SSLParameters params)
        Set the SSLParameters for this SSLSocket.
        Overrides:
        setSSLParameters in class javax.net.ssl.SSLEngine
        Parameters:
        params - SSLParameters to set for this SSLSocket object
      • setOut

        protected int setOut​(byte[] in,
                             int sz)
      • setIn

        protected int setIn​(byte[] toRead,
                            int sz)