public class TrustManagerFactory extends Object
TrustManagers based on KeyStore or provider
specific implementation.| Modifier | Constructor and Description |
|---|---|
protected |
TrustManagerFactory(TrustManagerFactorySpi factorySpi,
Provider provider,
String algorithm)
Creates a new
TrustManagerFactory instance. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAlgorithm()
Returns the name of this
TrustManagerFactory algorithm
implementation. |
static String |
getDefaultAlgorithm()
Returns the default algorithm name for the
TrustManagerFactory. |
static TrustManagerFactory |
getInstance(String algorithm)
Creates a new
TrustManagerFactory instance for the specified
trust management algorithm. |
static TrustManagerFactory |
getInstance(String algorithm,
Provider provider)
Creates a new
TrustManagerFactory instance for the specified
trust management algorithm from the specified provider. |
static TrustManagerFactory |
getInstance(String algorithm,
String provider)
Creates a new
TrustManagerFactory instance for the specified
trust management algorithm from the specified provider. |
Provider |
getProvider()
Returns the provider for this
TrustManagerFactory instance. |
TrustManager[] |
getTrustManagers()
Returns the list of
TrustManagers with one entry for each type
of trust material. |
void |
init(KeyStore ks)
Initializes this factory instance with the specified keystore as source
of certificate authorities and trust material.
|
void |
init(ManagerFactoryParameters spec)
Initializes this factory instance with the specified provider-specific
parameters for a source of trust material.
|
protected TrustManagerFactory(TrustManagerFactorySpi factorySpi, Provider provider, String algorithm)
TrustManagerFactory instance.factorySpi - the implementation delegate.provider - the provideralgorithm - the algorithm name.public static final String getDefaultAlgorithm()
TrustManagerFactory. The
default algorithm name is specified by the security property
'ssl.TrustManagerFactory.algorithm'.public static final TrustManagerFactory getInstance(String algorithm) throws NoSuchAlgorithmException
TrustManagerFactory instance for the specified
trust management algorithm.algorithm - the name of the requested trust 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 TrustManagerFactory getInstance(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
TrustManagerFactory instance for the specified
trust management algorithm from the specified provider.algorithm - the name of the requested trust 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 TrustManagerFactory getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException
TrustManagerFactory instance for the specified
trust 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()
TrustManagerFactory algorithm
implementation.TrustManagerFactory algorithm
implementation.public final Provider getProvider()
TrustManagerFactory instance.TrustManagerFactory instance.public final void init(KeyStore ks) throws KeyStoreException
ks - the keystore or null.KeyStoreException - if the initialization fails.public final void init(ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException
spec - the provider-specific parameters.InvalidAlgorithmParameterException - if the initialization fails.public final TrustManager[] getTrustManagers()
TrustManagers with one entry for each type
of trust material.TrustManagers