public class CertStore extends Object
Certificates and
CRLs from a read-only repository. This repository may be very large
and may store trusted as well as untrusted certificates.| Modifier | Constructor and Description |
|---|---|
protected |
CertStore(CertStoreSpi storeSpi,
Provider provider,
String type,
CertStoreParameters params)
Creates a new
CertStore instance. |
| Modifier and Type | Method and Description |
|---|---|
Collection<? extends Certificate> |
getCertificates(CertSelector selector)
Returns the list of
Certificates for the specified CertSelector from this certificate store. |
CertStoreParameters |
getCertStoreParameters()
Returns a copy of the certificate store parameters that were used to
initialize this instance.
|
Collection<? extends CRL> |
getCRLs(CRLSelector selector)
Returns the list of
CRLs for the specified CRLSelector
from this certificate store. |
static String |
getDefaultType()
Returns the default
CertStore type from the Security
Properties. |
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,
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,
String provider)
Creates a new
CertStore instance from the specified provider with
the specified type and initialized with the specified parameters. |
Provider |
getProvider()
Returns the security provider.
|
String |
getType()
Returns the certificate store type.
|
protected CertStore(CertStoreSpi storeSpi, Provider provider, String type, CertStoreParameters params)
CertStore instance.storeSpi - the implementation delegate.provider - the security provider.type - the certificate store type.params - the certificate store parameters (may be null.public static CertStore getInstance(String type, CertStoreParameters params) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
CertStore instance with the specified type and
initialized with the specified parameters.type - the certificate store type.params - the certificate store parameters (may be null).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 == nullpublic static CertStore getInstance(String type, CertStoreParameters params, String provider) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException
CertStore instance from the specified provider with
the specified type and initialized with the specified parameters.type - the certificate store type.params - the certificate store parameters (may be null).provider - the name of the provider.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 static CertStore getInstance(String type, CertStoreParameters params, Provider provider) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
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.type - the certificate store type.params - the certificate store parameters (may be null).provider - the name of the provider.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 == nullNullPointerException - if type == nullpublic final String getType()
public final Provider getProvider()
public final CertStoreParameters getCertStoreParameters()
null if
none were specified.public final Collection<? extends Certificate> getCertificates(CertSelector selector) throws CertStoreException
Certificates for the specified CertSelector from this certificate store.selector - the selector containing the criteria to search for
certificates in this certificate store.Certificates that match the criteria of the
specified selector.CertStoreException - if error(s) occur.public final Collection<? extends CRL> getCRLs(CRLSelector selector) throws CertStoreException
CRLs for the specified CRLSelector
from this certificate store.selector - the selector containing the criteria to search for certificate
revocation lists in this store.CRLs that match the criteria of the specified
selectorCertStoreException - if error(s) occur.public static final String getDefaultType()
CertStore type from the Security
Properties.CertStore type from the Security
Properties, or the string "LDAP" if it cannot be
determined.