Class SslContextConfigurator


  • public class SslContextConfigurator
    extends java.lang.Object
    Deprecated.
    Utility class, which helps to configure ssl context.

    Used to configure SslEngineConfigurator, which will be passed to client via configuration properties. Example:

          SslContextConfigurator sslContextConfigurator = new SslContextConfigurator();
          sslContextConfigurator.setTrustStoreFile("...");
          sslContextConfigurator.setTrustStorePassword("...");
          sslContextConfigurator.setTrustStoreType("...");
          sslContextConfigurator.setKeyStoreFile("...");
          sslContextConfigurator.setKeyStorePassword("...");
          sslContextConfigurator.setKeyStoreType("...");
          SslEngineConfigurator sslEngineConfigurator = new SslEngineConfigurator(sslContextConfigurator, true, false,
     false);
          client.getProperties().put(ClientManager.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
     
    Author:
    Alexey Stashok, Hubert Iwaniuk, Bruno Harbulot, Marek Potociar
    • Constructor Summary

      Constructors 
      Constructor Description
      SslContextConfigurator()
      Deprecated.
      Default constructor.
      SslContextConfigurator​(boolean readSystemProperties)
      Deprecated.
      Constructor that allows you creating empty configuration.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      javax.net.ssl.SSLContext createSSLContext()
      Deprecated.
       
      void retrieve​(java.util.Properties props)
      Deprecated.
       
      void setKeyManagerFactoryAlgorithm​(java.lang.String keyManagerFactoryAlgorithm)
      Deprecated.
      Sets the key manager factory algorithm.
      void setKeyPassword​(char[] keyPassword)
      Deprecated.
      Password of the key in the key store.
      void setKeyPassword​(java.lang.String keyPassword)
      Deprecated.
      Password of the key in the key store.
      void setKeyStoreBytes​(byte[] keyStoreBytes)
      Deprecated.
      Sets key store payload as byte array.
      void setKeyStoreFile​(java.lang.String keyStoreFile)
      Deprecated.
      Sets key store file name, also makes sure that if other key store configuration parameters are not set to set them to default values.
      void setKeyStorePassword​(char[] keyStorePassword)
      Deprecated.
      Password of key store.
      void setKeyStorePassword​(java.lang.String keyStorePassword)
      Deprecated.
      Password of key store.
      void setKeyStoreProvider​(java.lang.String keyStoreProvider)
      Deprecated.
      Sets the key store provider name.
      void setKeyStoreType​(java.lang.String keyStoreType)
      Deprecated.
      Type of key store.
      void setSecurityProtocol​(java.lang.String securityProtocol)
      Deprecated.
      Sets the SSLContext protocol.
      void setTrustManagerFactoryAlgorithm​(java.lang.String trustManagerFactoryAlgorithm)
      Deprecated.
      Sets the trust manager factory algorithm.
      void setTrustStoreBytes​(byte[] trustStoreBytes)
      Deprecated.
      Sets trust store payload as byte array.
      void setTrustStoreFile​(java.lang.String trustStoreFile)
      Deprecated.
      Sets trust store file name, also makes sure that if other trust store configuration parameters are not set to set them to default values.
      void setTrustStorePassword​(java.lang.String trustStorePassword)
      Deprecated.
      Password of trust store.
      void setTrustStoreProvider​(java.lang.String trustStoreProvider)
      Deprecated.
      Sets the trust store provider name.
      void setTrustStoreType​(java.lang.String trustStoreType)
      Deprecated.
      Type of trust store.
      boolean validateConfiguration()
      Deprecated.
      Validates SslContextConfigurator configuration.
      boolean validateConfiguration​(boolean needsKeyStore)
      Deprecated.
      Validates SslContextConfigurator configuration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TRUST_STORE_PROVIDER

        public static final java.lang.String TRUST_STORE_PROVIDER
        Deprecated.
        Trust store provider name.

        The value MUST be a String representing the name of a trust store provider.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.trustStoreProvider".

        See Also:
        Constant Field Values
      • KEY_STORE_PROVIDER

        public static final java.lang.String KEY_STORE_PROVIDER
        Deprecated.
        Key store provider name.

        The value MUST be a String representing the name of a trust store provider.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.keyStoreProvider".

        See Also:
        Constant Field Values
      • TRUST_STORE_FILE

        public static final java.lang.String TRUST_STORE_FILE
        Deprecated.
        Trust store file name.

        The value MUST be a String representing the name of a trust store file.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.trustStore".

        See Also:
        Constant Field Values
      • KEY_STORE_FILE

        public static final java.lang.String KEY_STORE_FILE
        Deprecated.
        Key store file name.

        The value MUST be a String representing the name of a key store file.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.keyStore".

        See Also:
        Constant Field Values
      • TRUST_STORE_PASSWORD

        public static final java.lang.String TRUST_STORE_PASSWORD
        Deprecated.
        Trust store file password - the password used to unlock the trust store file.

        The value MUST be a String representing the trust store file password.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.trustStorePassword".

        See Also:
        Constant Field Values
      • KEY_STORE_PASSWORD

        public static final java.lang.String KEY_STORE_PASSWORD
        Deprecated.
        Key store file password - the password used to unlock the trust store file.

        The value MUST be a String representing the key store file password.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.keyStorePassword".

        See Also:
        Constant Field Values
      • TRUST_STORE_TYPE

        public static final java.lang.String TRUST_STORE_TYPE
        Deprecated.
        Trust store type (see KeyStore.getType() for more info).

        The value MUST be a String representing the trust store type name.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.trustStoreType".

        See Also:
        Constant Field Values
      • KEY_STORE_TYPE

        public static final java.lang.String KEY_STORE_TYPE
        Deprecated.
        Key store type (see KeyStore.getType() for more info).

        The value MUST be a String representing the key store type name.

        No default value is set.

        The name of the configuration property is "javax.net.ssl.keyStoreType".

        See Also:
        Constant Field Values
      • KEY_FACTORY_MANAGER_ALGORITHM

        public static final java.lang.String KEY_FACTORY_MANAGER_ALGORITHM
        Deprecated.
        Key manager factory algorithm name.

        The value MUST be a String representing the key manager factory algorithm name.

        No default value is set.

        The name of the configuration property is "ssl.KeyManagerFactory.algorithm".

        See Also:
        Constant Field Values
      • TRUST_FACTORY_MANAGER_ALGORITHM

        public static final java.lang.String TRUST_FACTORY_MANAGER_ALGORITHM
        Deprecated.
        Trust manager factory algorithm name.

        The value MUST be a String representing the trust manager factory algorithm name.

        No default value is set.

        The name of the configuration property is "ssl.TrustManagerFactory.algorithm".

        See Also:
        Constant Field Values
      • DEFAULT_CONFIG

        public static final SslContextConfigurator DEFAULT_CONFIG
        Deprecated.
        Default SSL configuration. If you have changed any of System.getProperties() of javax.net.ssl family you should refresh this configuration by calling retrieve(java.util.Properties).
    • Constructor Detail

      • SslContextConfigurator

        public SslContextConfigurator()
        Deprecated.
        Default constructor. Reads configuration properties from System.getProperties(). Calls SslContextConfigurator(boolean) with true.
      • SslContextConfigurator

        public SslContextConfigurator​(boolean readSystemProperties)
        Deprecated.
        Constructor that allows you creating empty configuration.
        Parameters:
        readSystemProperties - If true populates configuration from System.getProperties(), else you have empty configuration.
    • Method Detail

      • setTrustStoreProvider

        public void setTrustStoreProvider​(java.lang.String trustStoreProvider)
        Deprecated.
        Sets the trust store provider name.
        Parameters:
        trustStoreProvider - Trust store provider to set.
      • setKeyStoreProvider

        public void setKeyStoreProvider​(java.lang.String keyStoreProvider)
        Deprecated.
        Sets the key store provider name.
        Parameters:
        keyStoreProvider - Key store provider to set.
      • setTrustStoreType

        public void setTrustStoreType​(java.lang.String trustStoreType)
        Deprecated.
        Type of trust store.
        Parameters:
        trustStoreType - Type of trust store to set.
      • setKeyStoreType

        public void setKeyStoreType​(java.lang.String keyStoreType)
        Deprecated.
        Type of key store.
        Parameters:
        keyStoreType - Type of key store to set.
      • setTrustStorePassword

        public void setTrustStorePassword​(java.lang.String trustStorePassword)
        Deprecated.
        Password of trust store.
        Parameters:
        trustStorePassword - Password of trust store to set.
      • setKeyStorePassword

        public void setKeyStorePassword​(java.lang.String keyStorePassword)
        Deprecated.
        Password of key store.
        Parameters:
        keyStorePassword - Password of key store to set.
      • setKeyStorePassword

        public void setKeyStorePassword​(char[] keyStorePassword)
        Deprecated.
        Password of key store.
        Parameters:
        keyStorePassword - Password of key store to set.
      • setKeyPassword

        public void setKeyPassword​(java.lang.String keyPassword)
        Deprecated.
        Password of the key in the key store.
        Parameters:
        keyPassword - Password of key to set.
      • setKeyPassword

        public void setKeyPassword​(char[] keyPassword)
        Deprecated.
        Password of the key in the key store.
        Parameters:
        keyPassword - Password of key to set.
      • setTrustStoreFile

        public void setTrustStoreFile​(java.lang.String trustStoreFile)
        Deprecated.
        Sets trust store file name, also makes sure that if other trust store configuration parameters are not set to set them to default values. Method resets trust store bytes if any have been set before via setTrustStoreBytes(byte[]).
        Parameters:
        trustStoreFile - File name of trust store.
      • setTrustStoreBytes

        public void setTrustStoreBytes​(byte[] trustStoreBytes)
        Deprecated.
        Sets trust store payload as byte array. Method resets trust store file if any has been set before via setTrustStoreFile(java.lang.String).
        Parameters:
        trustStoreBytes - trust store payload.
      • setKeyStoreFile

        public void setKeyStoreFile​(java.lang.String keyStoreFile)
        Deprecated.
        Sets key store file name, also makes sure that if other key store configuration parameters are not set to set them to default values. Method resets key store bytes if any have been set before via setKeyStoreBytes(byte[]).
        Parameters:
        keyStoreFile - File name of key store.
      • setKeyStoreBytes

        public void setKeyStoreBytes​(byte[] keyStoreBytes)
        Deprecated.
        Sets key store payload as byte array. Method resets key store file if any has been set before via setKeyStoreFile(java.lang.String).
        Parameters:
        keyStoreBytes - key store payload.
      • setTrustManagerFactoryAlgorithm

        public void setTrustManagerFactoryAlgorithm​(java.lang.String trustManagerFactoryAlgorithm)
        Deprecated.
        Sets the trust manager factory algorithm.
        Parameters:
        trustManagerFactoryAlgorithm - the trust manager factory algorithm.
      • setKeyManagerFactoryAlgorithm

        public void setKeyManagerFactoryAlgorithm​(java.lang.String keyManagerFactoryAlgorithm)
        Deprecated.
        Sets the key manager factory algorithm.
        Parameters:
        keyManagerFactoryAlgorithm - the key manager factory algorithm.
      • setSecurityProtocol

        public void setSecurityProtocol​(java.lang.String securityProtocol)
        Deprecated.
        Sets the SSLContext protocol. The default value is TLS if this is null.
        Parameters:
        securityProtocol - Protocol for SSLContext.getProtocol().
      • validateConfiguration

        public boolean validateConfiguration()
        Deprecated.
        Validates SslContextConfigurator configuration.
        Returns:
        true if configuration is valid, else false.
      • validateConfiguration

        public boolean validateConfiguration​(boolean needsKeyStore)
        Deprecated.
        Validates SslContextConfigurator configuration.
        Parameters:
        needsKeyStore - forces failure if no keystore is specified.
        Returns:
        true if configuration is valid, else false.
      • createSSLContext

        public javax.net.ssl.SSLContext createSSLContext()
        Deprecated.
      • retrieve

        public void retrieve​(java.util.Properties props)
        Deprecated.