CertStore that retrieves Certificates and
CRLs from a Collection.
This implementation is functionally equivalent to CollectionCertStore with two differences:
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.
java.security.cert.CertStore , CollectionCertStore
| Modifier and Type | Field and Description |
|---|---|
| private Map | certSubjects
Map X500Principal(subject) -> X509Certificate | List of X509Certificate |
| private Map | crlIssuers
Map X500Principal(issuer) -> X509CRL | List of X509CRL |
| private Set | otherCertificates
Sets of non-X509 certificates and CRLs |
| private Set |
| Access | Constructor and Description |
|---|---|
| public | IndexedCollectionCertStore(CertStoreParameters
the algorithm parameters params)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| private void | buildIndex(Collection<?> coll)
Index the specified Collection copying all references to Certificates and CRLs. |
| public Collection | Returns: aCollection of Certificates that
match the specified selectora selector)CertSelector used to select which
Certificates should be returned. Specify null
to return all Certificates.Implements abstract java. Returns a |
| public Collection | Returns: aCollection of CRLs that
match the specified selectora selector)CRLSelector used to select which
CRLs should be returned. Specify null
to return all CRLs.Implements abstract java. Returns a |
| private void | |
| private void | |
| private void | matchX509Certs(CertSelector selector, Collection<Certificate> matches)
Iterate through all the X509Certificates and add matches to the collection. |
| private void | matchX509CRLs(CRLSelector selector, Collection<CRL> matches)
Iterate through all the X509CRLs and add matches to the collection. |
| certSubjects | back to summary |
|---|---|
| private Map<X500Principal, Object> certSubjects Map X500Principal(subject) -> X509Certificate | List of X509Certificate | |
| crlIssuers | back to summary |
|---|---|
| private Map<X500Principal, Object> crlIssuers Map X500Principal(issuer) -> X509CRL | List of X509CRL | |
| otherCertificates | back to summary |
|---|---|
| private Set<Certificate> otherCertificates Sets of non-X509 certificates and CRLs | |
| otherCRLs | back to summary |
|---|---|
| private Set<CRL> otherCRLs | |
| IndexedCollectionCertStore | back to summary |
|---|---|
| public IndexedCollectionCertStore(CertStoreParameters params) throws InvalidAlgorithmParameterException Creates a
| |
| buildIndex | back to summary |
|---|---|
| private void buildIndex(Collection<?> coll) Index the specified Collection copying all references to Certificates and CRLs. | |
| engineGetCertificates | back to summary |
|---|---|
| public Collection Implements abstract java. Returns a
| |
| engineGetCRLs | back to summary |
|---|---|
| public Collection Implements abstract java. Returns a
| |
| indexCertificate | back to summary |
|---|---|
| private void indexCertificate(X509Certificate cert) Add an X509Certificate to the index. | |
| indexCRL | back to summary |
|---|---|
| private void indexCRL(X509CRL crl) Add an X509CRL to the index. | |
| matchX509Certs | back to summary |
|---|---|
| private void matchX509Certs(CertSelector selector, Collection<Certificate> matches) Iterate through all the X509Certificates and add matches to the collection. | |
| matchX509CRLs | back to summary |
|---|---|
| private void matchX509CRLs(CRLSelector selector, Collection<CRL> matches) Iterate through all the X509CRLs and add matches to the collection. | |