public class KeyManagerFactory extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
KeyManagerFactory(KeyManagerFactorySpi kmfSpi,
java.security.Provider provider,
java.lang.String algorithm)
Create a new key manager factory.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlgorithm()
Returns the name of this key manager factory algorithm.
|
static java.lang.String |
getDefaultAlgorithm()
Get the default algorithm name.
|
static KeyManagerFactory |
getInstance(java.lang.String algorithm)
Create an instance of the named key manager factory, from the first
provider that implements it.
|
static KeyManagerFactory |
getInstance(java.lang.String algorithm,
java.security.Provider provider)
Create an instance of the named key manager factory, from the given
provider.
|
static KeyManagerFactory |
getInstance(java.lang.String algorithm,
java.lang.String provider)
Create an instance of the named key manager factory, from the named
provider.
|
KeyManager[] |
getKeyManagers()
Get an array of key managers appropriate for this algorithm, with
the most preferred manager first.
|
java.security.Provider |
getProvider()
Returns the provider of this implementation.
|
void |
init(java.security.KeyStore store,
char[] passwd)
Initialize this instance with a key store and a password for
private key entries.
|
void |
init(ManagerFactoryParameters params)
Initialize this instance with an implementation-dependent
parameter object.
|
protected KeyManagerFactory(KeyManagerFactorySpi kmfSpi, java.security.Provider provider, java.lang.String algorithm)
kmfSpi - The underlying engine.provider - The engine's provider.algorithm - The name of this algorithm.public static final java.lang.String getDefaultAlgorithm()
public static final KeyManagerFactory getInstance(java.lang.String algorithm) throws java.security.NoSuchAlgorithmException
algorithm - The type of key manager factory to get.java.security.NoSuchAlgorithmException - If no provider implements the requested
algorithm.java.lang.IllegalArgumentException - if algorithm is
null or is an empty string.public static final KeyManagerFactory getInstance(java.lang.String algorithm, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
algorithm - The type of key manager factory to get.provider - The name of the provider to get the implementation from.java.security.NoSuchAlgorithmException - If the provider does not implement the
requested algorithm.java.security.NoSuchProviderException - If the named provider does not exist.java.lang.IllegalArgumentException - if either algorithm or
provider is null, or if
algorithm is an empty string.public static final KeyManagerFactory getInstance(java.lang.String algorithm, java.security.Provider provider) throws java.security.NoSuchAlgorithmException
algorithm - The type of key manager factory to get.provider - The provider to get the implementation from.java.security.NoSuchAlgorithmException - If the provider does not implement the
requested algorithm.java.lang.IllegalArgumentException - if either algorithm or
provider is null, or if
algorithm is an empty string.public final java.lang.String getAlgorithm()
public final KeyManager[] getKeyManagers()
public final java.security.Provider getProvider()
public final void init(ManagerFactoryParameters params) throws java.security.InvalidAlgorithmParameterException
params - The parameters to initialize with.java.security.InvalidAlgorithmParameterException - If the specified
parameters are inappropriate.public final void init(java.security.KeyStore store, char[] passwd) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
store - The key store to read.passwd - The password protecting private keys in the store.java.security.KeyStoreException - If an error occurs reading the keys.java.security.NoSuchAlgorithmException - If an algorithm (such as a
certificate algorithm) is not available.java.security.UnrecoverableKeyException - If the password is incorrect.