Class DefaultSSLContextInitializer

  • All Implemented Interfaces:
    SSLContextInitializer

    public class DefaultSSLContextInitializer
    extends AbstractSSLContextInitializer
    Provides a default implementation of SSL context initializer which allows the setting of trust and key managers in order to create an SSL context.
    Author:
    Middleware Services
    • Constructor Detail

      • DefaultSSLContextInitializer

        public DefaultSSLContextInitializer()
        Creates a new default ssl context initializer. Default trust managers will be produced.
      • DefaultSSLContextInitializer

        public DefaultSSLContextInitializer​(boolean defaultTrustManagers)
        Creates a new default ssl context initializer.
        Parameters:
        defaultTrustManagers - whether default trust managers should be created
    • Method Detail

      • createTrustManagers

        protected javax.net.ssl.TrustManager[] createTrustManagers()
                                                            throws java.security.GeneralSecurityException
        Description copied from class: AbstractSSLContextInitializer
        Creates any trust managers specific to this context initializer.
        Specified by:
        createTrustManagers in class AbstractSSLContextInitializer
        Returns:
        trust managers
        Throws:
        java.security.GeneralSecurityException - if an errors occurs while loading the TrustManagers
      • getKeyManagers

        public javax.net.ssl.KeyManager[] getKeyManagers()
                                                  throws java.security.GeneralSecurityException
        Description copied from interface: SSLContextInitializer
        Returns the key managers used when creating SSL contexts.
        Returns:
        key managers
        Throws:
        java.security.GeneralSecurityException - if an errors occurs while loading the KeyManagers
      • setKeyManagers

        public void setKeyManagers​(javax.net.ssl.KeyManager... managers)
        Sets the key managers.
        Parameters:
        managers - key managers
      • toString

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