Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

CertStore

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

Class Overview

This class provides the functionality to retrieve Certificate s and CRL s 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 CRL s 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 Certificate s 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.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

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

Added in API level 1

Creates a new CertStore instance.

Parameters
storeSpi the implementation delegate.
provider the security provider.
type the certificate store type.
params the certificate store parameters (may be null .

Public Methods

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

Added in API level 1

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

Parameters
selector the selector containing the criteria to search for certificate revocation lists in this store.
Returns
  • the list of CRL s that match the criteria of the specified selector
Throws
CertStoreException if error(s) occur.

public final CertStoreParameters getCertStoreParameters ()

Added in API level 1

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

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

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

Added in API level 1

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

Parameters
selector the selector containing the criteria to search for certificates in this certificate store.
Returns
  • the list of Certificate s that match the criteria of the specified selector.
Throws
CertStoreException if error(s) occur.

public static final String getDefaultType ()

Added in API level 1

Returns the default CertStore type from the Security Properties .

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

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

Added in API level 1

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

Parameters
type the certificate store type.
params the certificate store parameters (may be null ).
provider the name of the provider.
Returns
  • 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

public static CertStore getInstance ( String type, CertStoreParameters params)

Added in API level 1

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

Parameters
type the certificate store type.
params the certificate store parameters (may be null ).
Returns
  • 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

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

Added in API level 1

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

Parameters
type the certificate store type.
params the certificate store parameters (may be null ).
provider the name of the provider.
Returns
  • 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 .

public final Provider getProvider ()

Added in API level 1

Returns the security provider.

Returns
  • the security provider.

public final String getType ()

Added in API level 1

Returns the certificate store type.

Returns
  • the certificate store type.