Package javax.net.ssl

Class KeyManagerFactory


  • public class KeyManagerFactory
    extends Object
    The public API for KeyManagerFactory implementations.
    • Constructor Detail

      • KeyManagerFactory

        protected KeyManagerFactory​(KeyManagerFactorySpi factorySpi,
                                    Provider provider,
                                    String algorithm)
        Creates a new KeyManagerFactory.
        Parameters:
        factorySpi - the implementation delegate.
        provider - the provider.
        algorithm - the key management algorithm name.
    • Method Detail

      • getDefaultAlgorithm

        public static final String getDefaultAlgorithm()
        Returns the default key manager factory algorithm name.

        The default algorithm name is specified by the security property: 'ssl.KeyManagerFactory.algorithm'.

        Returns:
        the default algorithm name.
      • getInstance

        public static final KeyManagerFactory getInstance​(String algorithm)
                                                   throws NoSuchAlgorithmException
        Creates a new KeyManagerFactory instance for the specified key management algorithm.
        Parameters:
        algorithm - the name of the requested key management algorithm.
        Returns:
        a key manager factory for the requested algorithm.
        Throws:
        NoSuchAlgorithmException - if no installed provider can provide the requested algorithm.
        NullPointerException - if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getInstance

        public static final KeyManagerFactory getInstance​(String algorithm,
                                                          String provider)
                                                   throws NoSuchAlgorithmException,
                                                          NoSuchProviderException
        Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.
        Parameters:
        algorithm - the name of the requested key management algorithm name.
        provider - the name of the provider that provides the requested algorithm.
        Returns:
        a key manager factory for the requested algorithm.
        Throws:
        NoSuchAlgorithmException - if the specified provider cannot provide the requested algorithm.
        NoSuchProviderException - if the specified provider does not exist.
        NullPointerException - if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getInstance

        public static final KeyManagerFactory getInstance​(String algorithm,
                                                          Provider provider)
                                                   throws NoSuchAlgorithmException
        Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.
        Parameters:
        algorithm - the name of the requested key management algorithm name.
        provider - the provider that provides the requested algorithm.
        Returns:
        a key manager factory for the requested algorithm.
        Throws:
        NoSuchAlgorithmException - if the specified provider cannot provide the requested algorithm.
        NullPointerException - if algorithm is null (instead of NoSuchAlgorithmException as in 1.4 release)
      • getAlgorithm

        public final String getAlgorithm()
        Returns the name of the key management algorithm.
        Returns:
        the name of the key management algorithm.
      • getProvider

        public final Provider getProvider()
        Returns the provider for this KeyManagerFactory instance.
        Returns:
        the provider for this KeyManagerFactory instance.
      • getKeyManagers

        public final KeyManager[] getKeyManagers()
        Returns a list of key managers, one instance for each type of key in the key store.
        Returns:
        a list of key managers.