Class WolfSSLAuthStore


  • public class WolfSSLAuthStore
    extends java.lang.Object
    Helper class used to store common settings, objects, etc.
    • Constructor Detail

      • WolfSSLAuthStore

        protected WolfSSLAuthStore​(javax.net.ssl.KeyManager[] keyman,
                                   javax.net.ssl.TrustManager[] trustman,
                                   java.security.SecureRandom random,
                                   com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION version)
                            throws java.lang.IllegalArgumentException,
                                   java.security.KeyManagementException
        Parameters:
        keyman - key manager to use
        trustman - trust manager to use
        random - secure random
        version - TLS protocol version to use
        Throws:
        java.lang.IllegalArgumentException - when bad values are passed in
        java.security.KeyManagementException - in the case that getting keys fails
    • Method Detail

      • getX509KeyManager

        protected javax.net.ssl.X509KeyManager getX509KeyManager()
        Returns:
        get the key manager used
      • getX509TrustManager

        protected javax.net.ssl.X509TrustManager getX509TrustManager()
        Returns:
        get the trust manager used
      • getSecureRandom

        protected java.security.SecureRandom getSecureRandom()
        Returns:
        get secure random
      • getProtocolVersion

        protected com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION getProtocolVersion()
        Returns:
        get the current protocol version set
      • setCertAlias

        protected void setCertAlias​(java.lang.String in)
        Parameters:
        in - alias to set for certificate used
      • getCertAlias

        protected java.lang.String getCertAlias()
        Returns:
        alias name
      • getSession

        protected WolfSSLImplementSSLSession getSession​(WolfSSLSession ssl,
                                                        int port,
                                                        java.lang.String host,
                                                        boolean clientMode)
        Returns either an existing session to use or creates a new session. Can return null on error case or the case where session could not be created.
        Parameters:
        ssl - WOLFSSL class to set in session
        port - port number connecting to
        host - host connecting to
        clientMode - if is client side then true
        Returns:
        a new or reused SSLSession on success, null on failure
      • getSession

        protected WolfSSLImplementSSLSession getSession​(WolfSSLSession ssl)
        Returns a new session, does not check/save for resumption
        Parameters:
        ssl - WOLFSSL class to reference with new session
        Returns:
        a new SSLSession on success
      • addSession

        protected int addSession​(WolfSSLImplementSSLSession session)
        Add the session for possible resumption
        Parameters:
        session - the session to add to stored session map
        Returns:
        SSL_SUCCESS on success