Skip to content

Most visited

Recently visited

navigation
Added in API level 1

KeyManagerFactory

public class KeyManagerFactory
extends Object

java.lang.Object
   ↳ javax.net.ssl.KeyManagerFactory


The public API for KeyManagerFactory implementations.

Summary

Protected constructors

KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm)

Creates a new KeyManagerFactory.

Public methods

final String getAlgorithm()

Returns the name of the key management algorithm.

final static String getDefaultAlgorithm()

Returns the default key manager factory algorithm name.

final static KeyManagerFactory getInstance(String algorithm, String provider)

Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.

final static KeyManagerFactory getInstance(String algorithm, Provider provider)

Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.

final static KeyManagerFactory getInstance(String algorithm)

Creates a new KeyManagerFactory instance for the specified key management algorithm.

final KeyManager[] getKeyManagers()

Returns a list of key managers, one instance for each type of key in the key store.

final Provider getProvider()

Returns the provider for this KeyManagerFactory instance.

final void init(ManagerFactoryParameters spec)

Initializes this instance with the specified factory parameters.

final void init(KeyStore ks, char[] password)

Initializes this instance with the specified key store and password.

Inherited methods

From class java.lang.Object

Protected constructors

KeyManagerFactory

Added in API level 1
KeyManagerFactory (KeyManagerFactorySpi factorySpi, 
                Provider provider, 
                String algorithm)

Creates a new KeyManagerFactory.

Parameters
factorySpi KeyManagerFactorySpi: the implementation delegate.
provider Provider: the provider.
algorithm String: the key management algorithm name.

Public methods

getAlgorithm

Added in API level 1
String getAlgorithm ()

Returns the name of the key management algorithm.

Returns
String the name of the key management algorithm.

getDefaultAlgorithm

Added in API level 1
String getDefaultAlgorithm ()

Returns the default key manager factory algorithm name.

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

Returns
String the default algorithm name.

getInstance

Added in API level 1
KeyManagerFactory getInstance (String algorithm, 
                String provider)

Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.

Parameters
algorithm String: the name of the requested key management algorithm name.
provider String: the name of the provider that provides the requested algorithm.
Returns
KeyManagerFactory 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

Added in API level 1
KeyManagerFactory getInstance (String algorithm, 
                Provider provider)

Creates a new KeyManagerFactory instance for the specified key management algorithm from the specified provider.

Parameters
algorithm String: the name of the requested key management algorithm name.
provider Provider: the provider that provides the requested algorithm.
Returns
KeyManagerFactory 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)

getInstance

Added in API level 1
KeyManagerFactory getInstance (String algorithm)

Creates a new KeyManagerFactory instance for the specified key management algorithm.

Parameters
algorithm String: the name of the requested key management algorithm.
Returns
KeyManagerFactory 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)

getKeyManagers

Added in API level 1
KeyManager[] getKeyManagers ()

Returns a list of key managers, one instance for each type of key in the key store.

Returns
KeyManager[] a list of key managers.

getProvider

Added in API level 1
Provider getProvider ()

Returns the provider for this KeyManagerFactory instance.

Returns
Provider the provider for this KeyManagerFactory instance.

init

Added in API level 1
void init (ManagerFactoryParameters spec)

Initializes this instance with the specified factory parameters.

Parameters
spec ManagerFactoryParameters: the factory parameters.
Throws
InvalidAlgorithmParameterException if an error occurs.

init

Added in API level 1
void init (KeyStore ks, 
                char[] password)

Initializes this instance with the specified key store and password.

Parameters
ks KeyStore: the key store or null to use the default key store.
password char: the password for the specified key store or null if no key store is provided.
Throws
KeyStoreException if initializing this key manager factory fails.
NoSuchAlgorithmException if a required algorithm is not available.
UnrecoverableKeyException if a key cannot be recovered.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.