Skip to content

Most visited

Recently visited

navigation
Added in API level 1

TrustManagerFactory

public class TrustManagerFactory
extends Object

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


The factory for TrustManagers based on KeyStore or provider specific implementation.

Summary

Protected constructors

TrustManagerFactory(TrustManagerFactorySpi factorySpi, Provider provider, String algorithm)

Creates a new TrustManagerFactory instance.

Public methods

final String getAlgorithm()

Returns the name of this TrustManagerFactory algorithm implementation.

final static String getDefaultAlgorithm()

Returns the default algorithm name for the TrustManagerFactory.

final static TrustManagerFactory getInstance(String algorithm, String provider)

Creates a new TrustManagerFactory instance for the specified trust management algorithm from the specified provider.

final static TrustManagerFactory getInstance(String algorithm, Provider provider)

Creates a new TrustManagerFactory instance for the specified trust management algorithm from the specified provider.

final static TrustManagerFactory getInstance(String algorithm)

Creates a new TrustManagerFactory instance for the specified trust management algorithm.

final Provider getProvider()

Returns the provider for this TrustManagerFactory instance.

final TrustManager[] getTrustManagers()

Returns the list of TrustManagers with one entry for each type of trust material.

final void init(ManagerFactoryParameters spec)

Initializes this factory instance with the specified provider-specific parameters for a source of trust material.

final void init(KeyStore ks)

Initializes this factory instance with the specified keystore as source of certificate authorities and trust material.

Inherited methods

From class java.lang.Object

Protected constructors

TrustManagerFactory

Added in API level 1
TrustManagerFactory (TrustManagerFactorySpi factorySpi, 
                Provider provider, 
                String algorithm)

Creates a new TrustManagerFactory instance.

Parameters
factorySpi TrustManagerFactorySpi: the implementation delegate.
provider Provider: the provider
algorithm String: the algorithm name.

Public methods

getAlgorithm

Added in API level 1
String getAlgorithm ()

Returns the name of this TrustManagerFactory algorithm implementation.

Returns
String the name of this TrustManagerFactory algorithm implementation.

getDefaultAlgorithm

Added in API level 1
String getDefaultAlgorithm ()

Returns the default algorithm name for the TrustManagerFactory. The default algorithm name is specified by the security property 'ssl.TrustManagerFactory.algorithm'.

Returns
String the default algorithm name.

getInstance

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

Creates a new TrustManagerFactory instance for the specified trust management algorithm from the specified provider.

Parameters
algorithm String: the name of the requested trust management algorithm name.
provider String: the name of the provider that provides the requested algorithm.
Returns
TrustManagerFactory a trust 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
TrustManagerFactory getInstance (String algorithm, 
                Provider provider)

Creates a new TrustManagerFactory instance for the specified trust 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
TrustManagerFactory 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
TrustManagerFactory getInstance (String algorithm)

Creates a new TrustManagerFactory instance for the specified trust management algorithm.

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

getProvider

Added in API level 1
Provider getProvider ()

Returns the provider for this TrustManagerFactory instance.

Returns
Provider the provider for this TrustManagerFactory instance.

getTrustManagers

Added in API level 1
TrustManager[] getTrustManagers ()

Returns the list of TrustManagers with one entry for each type of trust material.

Returns
TrustManager[] the list of TrustManagers

init

Added in API level 1
void init (ManagerFactoryParameters spec)

Initializes this factory instance with the specified provider-specific parameters for a source of trust material.

Parameters
spec ManagerFactoryParameters: the provider-specific parameters.
Throws
InvalidAlgorithmParameterException if the initialization fails.

init

Added in API level 1
void init (KeyStore ks)

Initializes this factory instance with the specified keystore as source of certificate authorities and trust material.

Parameters
ks KeyStore: the keystore or null.
Throws
KeyStoreException if the initialization fails.
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.