Top Description Fields Constructors Methods
sun.security.provider.certpath

public Class CollectionCertStore

extends CertStoreSpi
Class Inheritance
Imports
java.security.InvalidAlgorithmParameterException, java.security.cert.*, java.util.Collection, .ConcurrentModificationException, .HashSet

A CertStore that retrieves Certificates and CRLs from a Collection.

Before calling the engineGetCertificates or engineGetCRLs methods, the CollectionCertStore(CertStoreParameters) constructor is called to create the CertStore and establish the Collection from which Certificates and CRLs will be retrieved. If the specified Collection contains an object that is not a Certificate or CRL, that object will be ignored.

Concurrent Access

As described in the javadoc for CertStoreSpi, the engineGetCertificates and engineGetCRLs methods must be thread-safe. That is, multiple threads may concurrently invoke these methods on a single CollectionCertStore object (or more than one) with no ill effects.

This is achieved by requiring that the Collection passed to the CollectionCertStore(CertStoreParameters) constructor (via the CollectionCertStoreParameters object) must have fail-fast iterators. Simultaneous modifications to the Collection can thus be detected and certificate or CRL retrieval can be retried. The fact that Certificates and CRLs must be thread-safe is also essential.

Author
Steve Hanna
Since
1.4
See Also
java.security.cert.CertStore

Field Summary

Modifier and TypeField and Description
private final Collection<?>

Constructor Summary

AccessConstructor and Description
public
CollectionCertStore(CertStoreParameters
the algorithm parameters
params
)

Creates a CertStore with the specified parameters.

Method Summary

Modifier and TypeMethod and Description
public Collection<Certificate>

Returns:

a Collection of Certificates that match the specified selector
engineGetCertificates
(CertSelector
a CertSelector used to select which Certificates should be returned. Specify null to return all Certificates.
selector
)

Implements abstract java.security.cert.CertStoreSpi.engineGetCertificates.

Returns a Collection of Certificates that match the specified selector.

public Collection<CRL>

Returns:

a Collection of CRLs that match the specified selector
engineGetCRLs
(CRLSelector
a CRLSelector used to select which CRLs should be returned. Specify null to return all CRLs.
selector
)

Implements abstract java.security.cert.CertStoreSpi.engineGetCRLs.

Returns a Collection of CRLs that match the specified selector.

Field Detail

collback to summary
private final Collection<?> coll

Constructor Detail

CollectionCertStoreback to summary
public CollectionCertStore(CertStoreParameters params) throws InvalidAlgorithmParameterException

Creates a CertStore with the specified parameters. For this class, the parameters object must be an instance of CollectionCertStoreParameters. The Collection included in the CollectionCertStoreParameters object must be thread-safe.

Parameters
params:CertStoreParameters

the algorithm parameters

Exceptions
InvalidAlgorithmParameterException:
if params is not an instance of CollectionCertStoreParameters

Method Detail

engineGetCertificatesback to summary
public Collection<Certificate> engineGetCertificates(CertSelector selector) throws CertStoreException

Implements abstract java.security.cert.CertStoreSpi.engineGetCertificates.

Returns a Collection of Certificates that match the specified selector. If no Certificates match the selector, an empty Collection will be returned.

Parameters
selector:CertSelector

a CertSelector used to select which Certificates should be returned. Specify null to return all Certificates.

Returns:Collection<Certificate>

a Collection of Certificates that match the specified selector

Annotations
@Override
Exceptions
CertStoreException:
if an exception occurs
engineGetCRLsback to summary
public Collection<CRL> engineGetCRLs(CRLSelector selector) throws CertStoreException

Implements abstract java.security.cert.CertStoreSpi.engineGetCRLs.

Returns a Collection of CRLs that match the specified selector. If no CRLs match the selector, an empty Collection will be returned.

Parameters
selector:CRLSelector

a CRLSelector used to select which CRLs should be returned. Specify null to return all CRLs.

Returns:Collection<CRL>

a Collection of CRLs that match the specified selector

Annotations
@Override
Exceptions
CertStoreException:
if an exception occurs