| |
|
| java.lang.Object javax.net.ssl.KeyManagerFactory
KeyManagerFactory | public class KeyManagerFactory (Code) | | This class acts as a factory for key managers based on a
source of key material. Each key manager manages a specific
type of key material for use by secure sockets. The key
material is based on a KeyStore and/or provider specific sources.
since: 1.4 See Also: KeyManager version: 1.28, 05/05/07 |
Method Summary | |
final public String | getAlgorithm() Returns the algorithm name of this KeyManagerFactory object. | final public static String | getDefaultAlgorithm() Obtains the default KeyManagerFactory algorithm name. | final public static KeyManagerFactory | getInstance(String algorithm) Returns a KeyManagerFactory object that acts as a
factory for key managers.
This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new KeyManagerFactory object encapsulating the
KeyManagerFactorySpi implementation from the first
Provider that supports the specified algorithm is returned.
Note that the list of registered providers may be retrieved via
the
Security.getProviders Security.getProviders() method.
Parameters: algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names. | final public static KeyManagerFactory | getInstance(String algorithm, String provider) Returns a KeyManagerFactory object that acts as a
factory for key managers.
A new KeyManagerFactory object encapsulating the
KeyManagerFactorySpi implementation from the specified provider
is returned. | final public static KeyManagerFactory | getInstance(String algorithm, Provider provider) Returns a KeyManagerFactory object that acts as a
factory for key managers.
A new KeyManagerFactory object encapsulating the
KeyManagerFactorySpi implementation from the specified Provider
object is returned. | final public KeyManager[] | getKeyManagers() Returns one key manager for each type of key material. | final public Provider | getProvider() Returns the provider of this KeyManagerFactory object. | final public void | init(KeyStore ks, char[] password) Initializes this factory with a source of key material.
The provider typically uses a KeyStore for obtaining
key material for use during secure socket negotiations.
The KeyStore is generally password-protected.
For more flexible initialization, please see
KeyManagerFactory.init(ManagerFactoryParameters) .
Parameters: ks - the key store or null Parameters: password - the password for recovering keys in the KeyStore throws: KeyStoreException - if this operation fails throws: NoSuchAlgorithmException - if the specified algorithm is notavailable from the specified provider. throws: UnrecoverableKeyException - if the key cannot be recovered(e.g. | final public void | init(ManagerFactoryParameters spec) Initializes this factory with a source of provider-specific
key material.
In some cases, initialization parameters other than a keystore
and password may be needed by a provider. |
KeyManagerFactory | protected KeyManagerFactory(KeyManagerFactorySpi factorySpi, Provider provider, String algorithm)(Code) | | Creates a KeyManagerFactory object.
Parameters: factorySpi - the delegate Parameters: provider - the provider Parameters: algorithm - the algorithm |
getAlgorithm | final public String getAlgorithm()(Code) | | Returns the algorithm name of this KeyManagerFactory object.
This is the same name that was specified in one of the
getInstance calls that created this
KeyManagerFactory object.
the algorithm name of this KeyManagerFactory object. |
getInstance | final public static KeyManagerFactory getInstance(String algorithm) throws NoSuchAlgorithmException(Code) | | Returns a KeyManagerFactory object that acts as a
factory for key managers.
This method traverses the list of registered security Providers,
starting with the most preferred Provider.
A new KeyManagerFactory object encapsulating the
KeyManagerFactorySpi implementation from the first
Provider that supports the specified algorithm is returned.
Note that the list of registered providers may be retrieved via
the
Security.getProviders Security.getProviders() method.
Parameters: algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names. the new KeyManagerFactory object. exception: NoSuchAlgorithmException - if no Provider supports aKeyManagerFactorySpi implementation for thespecified algorithm. exception: NullPointerException - if algorithm is null. See Also: java.security.Provider |
getInstance | final public static KeyManagerFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException(Code) | | Returns a KeyManagerFactory object that acts as a
factory for key managers.
A new KeyManagerFactory object encapsulating the
KeyManagerFactorySpi implementation from the specified Provider
object is returned. Note that the specified Provider object
does not have to be registered in the provider list.
Parameters: algorithm - the standard name of the requested algorithm.See the Java Secure Socket Extension Reference Guide for information about standard algorithm names. Parameters: provider - an instance of the provider. the new KeyManagerFactory object. throws: NoSuchAlgorithmException - if a KeyManagerFactorySpiimplementation for the specified algorithm is not availablefrom the specified Provider object. throws: IllegalArgumentException - if provider is null. throws: NullPointerException - if algorithm is null. See Also: java.security.Provider |
getKeyManagers | final public KeyManager[] getKeyManagers()(Code) | | Returns one key manager for each type of key material.
the key managers throws: IllegalStateException - if the KeyManagerFactory is not initialized |
getProvider | final public Provider getProvider()(Code) | | Returns the provider of this KeyManagerFactory object.
the provider of this KeyManagerFactory object |
init | final public void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException(Code) | | Initializes this factory with a source of provider-specific
key material.
In some cases, initialization parameters other than a keystore
and password may be needed by a provider. Users of that
particular provider are expected to pass an implementation of
the appropriate ManagerFactoryParameters as
defined by the provider. The provider can then call the
specified methods in the ManagerFactoryParameters
implementation to obtain the needed information.
Parameters: spec - an implementation of a provider-specific parameterspecification throws: InvalidAlgorithmParameterException - if an error is encountered |
|
|
|