public class CertificateGraph extends CertificateStore
CertificateGraph is a singleton (see Design Patterns by E. Gamma et al.).
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCertificate(X509Certificate cert)
Adds a certificate to the graph and connects it to all issuers and all
subjects.
|
void |
clear()
Removes all certificates from the CertificateGraph singleton.
|
CertificateSet |
findCerts(GeneralName location)
Generalized version of findCerts.
|
CertificateSet |
findCerts(java.security.Principal dn)
Returns all certificates for the entity specified in
dn. |
X509Certificate[] |
getCertificates()
This method returns all certificates that are currently in
the certificate graph.
|
int |
getTotalNumberOfCertificates()
This method returns the total number of certificates in the certificate graph.
|
static CertificateGraph |
Graph()
Returns the Certificate Graph.
|
void |
removeCertificate(X509Certificate cert)
Removes a certificate from the graph.
|
findpublic CertificateSet findCerts(java.security.Principal dn)
dn. If
no certificate is found, this method returns null.findCerts in class CertificateStoredn - the distinguished name of the key ownerdn or null if no
certificates for dn are found in this
CertificateStorepublic CertificateSet findCerts(GeneralName location) throws CertificationException
findCerts in class CertificateStorelocation - The GeneralName. It must represent a type of
java.security.Principal or this check cannot be done.location, or
null if no certificates for location are
found in this CertificateStoreCertificationException - if there is a problem finding the certificates.public boolean addCertificate(X509Certificate cert)
cert - the certificate to addtrue if the certificate was addedpublic void removeCertificate(X509Certificate cert)
cert - the certificate to removepublic static CertificateGraph Graph()
public void clear()
After the Toolkit has completed a certificate validation, the
CertificateGraph singleton contains certificates collected while path
finding. When testing certificate validations, this methods lets you
create new CertVerifier objects that initialize from an
empty Certificate Graph.
In any case, when this method is invoked, all CertVerifier and
CollectionCS objects are immediately invalidated.
Never call it while a certificate validation is in progress or a user
is logged in.
CertVerifierpublic int getTotalNumberOfCertificates()
public X509Certificate[] getCertificates()