Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CertStore

public class CertStore
extends Object

java.lang.Object
   ↳ java.security.cert.CertStore


This class provides the functionality to retrieve Certificates and CRLs from a read-only repository. This repository may be very large and may store trusted as well as untrusted certificates.

Summary

Protected constructors

CertStore(CertStoreSpi storeSpi, Provider provider, String type, CertStoreParameters params)

Creates a new CertStore instance.

Public methods

final Collection<? extends CRL> getCRLs(CRLSelector selector)

Returns the list of CRLs for the specified CRLSelector from this certificate store.

final CertStoreParameters getCertStoreParameters()

Returns a copy of the certificate store parameters that were used to initialize this instance.

final Collection<? extends Certificate> getCertificates(CertSelector selector)

Returns the list of Certificates for the specified CertSelector from this certificate store.

final static String getDefaultType()

Returns the default CertStore type from the Security Properties.

static CertStore getInstance(String type, CertStoreParameters params, Provider provider)

Creates a new CertStore instance from the specified provider with the specified type and initialized with the specified parameters.

static CertStore getInstance(String type, CertStoreParameters params)

Creates a new CertStore instance with the specified type and initialized with the specified parameters.

static CertStore getInstance(String type, CertStoreParameters params, String provider)

Creates a new CertStore instance from the specified provider with the specified type and initialized with the specified parameters.

final Provider getProvider()

Returns the security provider.

final String getType()

Returns the certificate store type.

Inherited methods

From class java.lang.Object

Protected constructors

CertStore

Added in API level 1
CertStore (CertStoreSpi storeSpi, 
                Provider provider, 
                String type, 
                CertStoreParameters params)

Creates a new CertStore instance.

Parameters
storeSpi CertStoreSpi: the implementation delegate.
provider Provider: the security provider.
type String: the certificate store type.
params CertStoreParameters: the certificate store parameters (may be null.

Public methods

getCRLs

Added in API level 1
Collection<? extends CRL> getCRLs (CRLSelector selector)

Returns the list of CRLs for the specified CRLSelector from this certificate store.

Parameters
selector CRLSelector: the selector containing the criteria to search for certificate revocation lists in this store.
Returns
Collection<? extends CRL> the list of CRLs that match the criteria of the specified selector
Throws
CertStoreException if error(s) occur.

getCertStoreParameters

Added in API level 1
CertStoreParameters getCertStoreParameters ()

Returns a copy of the certificate store parameters that were used to initialize this instance.

Returns
CertStoreParameters a copy of the certificate store parameters or null if none were specified.

getCertificates

Added in API level 1
Collection<? extends Certificate> getCertificates (CertSelector selector)

Returns the list of Certificates for the specified CertSelector from this certificate store.

Parameters
selector CertSelector: the selector containing the criteria to search for certificates in this certificate store.
Returns
Collection<? extends Certificate> the list of Certificates that match the criteria of the specified selector.
Throws
CertStoreException if error(s) occur.

getDefaultType

Added in API level 1
String getDefaultType ()

Returns the default CertStore type from the Security Properties.

Returns
String the default CertStore type from the Security Properties, or the string "LDAP" if it cannot be determined.

getInstance

Added in API level 1
CertStore getInstance (String type, 
                CertStoreParameters params, 
                Provider provider)

Creates a new CertStore instance from the specified provider with the specified type and initialized with the specified parameters. The provider supplied does not have to be registered.

Parameters
type String: the certificate store type.
params CertStoreParameters: the certificate store parameters (may be null).
provider Provider: the name of the provider.
Returns
CertStore the new certificate store instance.
Throws
NoSuchAlgorithmException if the specified provider cannot provide the requested certificate store type.
InvalidAlgorithmParameterException if the specified parameters cannot be used to initialize this certificate store instance.
IllegalArgumentException if provider == null
NullPointerException if type == null

getInstance

Added in API level 1
CertStore getInstance (String type, 
                CertStoreParameters params)

Creates a new CertStore instance with the specified type and initialized with the specified parameters.

Parameters
type String: the certificate store type.
params CertStoreParameters: the certificate store parameters (may be null).
Returns
CertStore the new certificate store instance.
Throws
NoSuchAlgorithmException if no provider can provide the specified certificate store type.
InvalidAlgorithmParameterException if the specified parameters cannot be used to initialize this certificate store instance.
NullPointerException if type == null

getInstance

Added in API level 1
CertStore getInstance (String type, 
                CertStoreParameters params, 
                String provider)

Creates a new CertStore instance from the specified provider with the specified type and initialized with the specified parameters.

Parameters
type String: the certificate store type.
params CertStoreParameters: the certificate store parameters (may be null).
provider String: the name of the provider.
Returns
CertStore the new certificate store instance.
Throws
NoSuchAlgorithmException if the specified provider cannot provide the requested certificate store type.
NoSuchProviderException if no provider with the specified name can be found.
InvalidAlgorithmParameterException if the specified parameters cannot be used to initialize this certificate store instance.
IllegalArgumentException if provider == null || provider.isEmpty()
NullPointerException if type is null.

getProvider

Added in API level 1
Provider getProvider ()

Returns the security provider.

Returns
Provider the security provider.

getType

Added in API level 1
String getType ()

Returns the certificate store type.

Returns
String the certificate store type.
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.