public class KeyManagerFactory extends Object
KeyManagerFactory implementations.| Modifier | Constructor and Description |
|---|---|
protected |
KeyManagerFactory(KeyManagerFactorySpi factorySpi,
Provider provider,
String algorithm)
Creates a new
KeyManagerFactory. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAlgorithm()
Returns the name of the key management algorithm.
|
static String |
getDefaultAlgorithm()
Returns the default key manager factory algorithm name.
|
static KeyManagerFactory |
getInstance(String algorithm)
Creates a new
KeyManagerFactory instance for the specified key
management algorithm. |
static KeyManagerFactory |
getInstance(String algorithm,
Provider provider)
Creates a new
KeyManagerFactory instance for the specified key
management algorithm from the specified provider. |
static KeyManagerFactory |
getInstance(String algorithm,
String provider)
Creates a new
KeyManagerFactory instance for the specified key
management algorithm from the specified provider. |
KeyManager[] |
getKeyManagers()
Returns a list of key managers, one instance for each type of key in the
key store.
|
Provider |
getProvider()
Returns the provider for this
KeyManagerFactory instance. |
void |
init(KeyStore ks,
char[] password)
Initializes this instance with the specified key store and password.
|
void |
init(ManagerFactoryParameters spec)
Initializes this instance with the specified factory parameters.
|
protected KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm)
KeyManagerFactory.factorySpi - the implementation delegate.provider - the provider.algorithm - the key management algorithm name.public static final String getDefaultAlgorithm()
The default algorithm name is specified by the security property:
'ssl.KeyManagerFactory.algorithm'.
public static final KeyManagerFactory getInstance(String algorithm) throws NoSuchAlgorithmException
KeyManagerFactory instance for the specified key
management algorithm.algorithm - the name of the requested key management algorithm.NoSuchAlgorithmException - if no installed provider can provide the requested algorithm.NullPointerException - if algorithm is null (instead of
NoSuchAlgorithmException as in 1.4 release)public static final KeyManagerFactory getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
KeyManagerFactory instance for the specified key
management algorithm from the specified provider.algorithm - the name of the requested key management algorithm name.provider - the name of the provider that provides the requested
algorithm.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)public static final KeyManagerFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
KeyManagerFactory instance for the specified key
management algorithm from the specified provider.algorithm - the name of the requested key management algorithm name.provider - the provider that provides the requested algorithm.NoSuchAlgorithmException - if the specified provider cannot provide the requested
algorithm.NullPointerException - if algorithm is null (instead of
NoSuchAlgorithmException as in 1.4 release)public final String getAlgorithm()
public final Provider getProvider()
KeyManagerFactory instance.KeyManagerFactory instance.public final void init(KeyStore ks, char[] password) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException
ks - the key store or null to use the default key store.password - the password for the specified key store or null if no
key store is provided.KeyStoreException - if initializing this key manager factory fails.NoSuchAlgorithmException - if a required algorithm is not available.UnrecoverableKeyException - if a key cannot be recovered.public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException
spec - the factory parameters.InvalidAlgorithmParameterException - if an error occurs.public final KeyManager[] getKeyManagers()