Class KeyStoreSSLContextInitializer

    • Field Detail

      • trustKeystore

        private KeyStore trustKeystore
        KeyStore used to create trust managers.
      • trustAliases

        private String[] trustAliases
        Aliases of trust entries to use.
      • authenticationKeystore

        private KeyStore authenticationKeystore
        KeyStore used to create key managers.
      • authenticationAliases

        private String[] authenticationAliases
        Aliases of key entries to use.
      • authenticationPassword

        private char[] authenticationPassword
        Password used to access the authentication keystore.
    • Constructor Detail

      • KeyStoreSSLContextInitializer

        public KeyStoreSSLContextInitializer()
    • Method Detail

      • getTrustKeystore

        public KeyStore getTrustKeystore()
        Returns the keystore to use for creating the trust managers.
        Returns:
        keystore
      • setTrustKeystore

        public void setTrustKeystore​(KeyStore keystore)
        Sets the keystore to use for creating the trust managers.
        Parameters:
        keystore - to set
      • getTrustAliases

        public String[] getTrustAliases()
        Returns the aliases of the entries to use in the trust keystore
        Returns:
        trust aliases
      • setTrustAliases

        public void setTrustAliases​(String... aliases)
        Sets the aliases of the entries to use in the trust keystore.
        Parameters:
        aliases - to use
      • getAuthenticationKeystore

        public KeyStore getAuthenticationKeystore()
        Returns the keystore to use for creating the key managers.
        Returns:
        keystore
      • setAuthenticationKeystore

        public void setAuthenticationKeystore​(KeyStore keystore)
        Sets the keystore to use for creating the key managers.
        Parameters:
        keystore - to set
      • getAuthenticationAliases

        public String[] getAuthenticationAliases()
        Returns the aliases of the entries to use in the authentication keystore
        Returns:
        authentication aliases
      • setAuthenticationAliases

        public void setAuthenticationAliases​(String... aliases)
        Sets the aliases of the entries to use in the authentication keystore.
        Parameters:
        aliases - to use
      • getAuthenticationPassword

        public char[] getAuthenticationPassword()
        Returns the password used for accessing the authentication keystore.
        Returns:
        authentication password
      • setAuthenticationPassword

        public void setAuthenticationPassword​(char[] password)
        Sets the password used for accessing the authentication keystore.
        Parameters:
        password - to use for authentication
      • getTrustManagerFactory

        protected TrustManagerFactory getTrustManagerFactory​(KeyStore keystore,
                                                             String... aliases)
                                                      throws GeneralSecurityException
        Creates a new trust manager factory.
        Parameters:
        keystore - to initialize the trust manager factory
        aliases - to include from the supplied keystore or null to include all entries
        Returns:
        trust manager factory
        Throws:
        GeneralSecurityException - if the trust manager factory cannot be initialized
      • getKeyManagerFactory

        protected KeyManagerFactory getKeyManagerFactory​(KeyStore keystore,
                                                         char[] password,
                                                         String... aliases)
                                                  throws GeneralSecurityException
        Creates a new key manager factory.
        Parameters:
        keystore - to initialize the key manager factory
        password - to unlock the supplied keystore
        aliases - to include from the supplied keystore or null to include all entries
        Returns:
        key manager factory
        Throws:
        GeneralSecurityException - if the key manager factory cannot be initialized