org.nhindirect.stagent.cert
Class CertificateStore

java.lang.Object
  extended by org.nhindirect.stagent.cert.CertificateStore
All Implemented Interfaces:
CertificateResolver, X509Store

public abstract class CertificateStore
extends Object
implements X509Store, CertificateResolver

Abstract base class for a certificate store implementation. It does not implement any specific certificate storage functions against a certificate repository implementation. Storage specific implementation should over ride this class to communicate with the underlying storage medium.

Author:
Greg Meyer, Umesh Madan

Constructor Summary
CertificateStore()
           
 
Method Summary
 void add(Collection<X509Certificate> certs)
          Adds a collection of certificates to the store.
abstract  void add(X509Certificate cert)
          Adds a certificate to the store.
abstract  boolean contains(X509Certificate cert)
          Determines if a certificate exists in the certificate store.
abstract  Collection<X509Certificate> getAllCertificates()
          Gets all certificates in the store.
 Collection<X509Certificate> getCertificates(javax.mail.internet.InternetAddress address)
          Retrieves a collection of certificates for a given InternetAddress.
 Collection<X509Certificate> getCertificates(String subjectName)
          Gets a collection of certificates where the cert's E or CN field match the subject name.
 void remove(Collection<X509Certificate> certs)
          Removes a collection certificates from the store.
 void remove(String subjectName)
          Removes certificates from the store matching the subject name.
abstract  void remove(X509Certificate cert)
          Removes a certificate from the store.
 void update(Collection<X509Certificate> certs)
          Updates a collection of existing certificate in the store with a new representations of the certificates.
 void update(X509Certificate cert)
          Updates an existing certificate in the store with a new representation of the certificate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CertificateStore

public CertificateStore()
Method Detail

contains

public abstract boolean contains(X509Certificate cert)
Determines if a certificate exists in the certificate store. Although not specific in the interface definition, certificate thumbprinting is recommended for certificate searching.

Specified by:
contains in interface X509Store
Parameters:
cert - The certificate to search for.
Returns:
True if the certificate exist in the store. False otherwise.

add

public abstract void add(X509Certificate cert)
Adds a certificate to the store.

Specified by:
add in interface X509Store
Parameters:
cert - The certificate to add to the store.

remove

public abstract void remove(X509Certificate cert)
Removes a certificate from the store.

Specified by:
remove in interface X509Store
Parameters:
cert - The certificate to remove from the store.

getCertificates

public Collection<X509Certificate> getCertificates(String subjectName)
Gets a collection of certificates where the cert's E or CN field match the subject name.

Specified by:
getCertificates in interface X509Store
Parameters:
subjectName - The subject name to search for.
Returns:
A collection of certificates matching the subject name.

add

public void add(Collection<X509Certificate> certs)
Adds a collection of certificates to the store.

Specified by:
add in interface X509Store
Parameters:
certs - The certificates to add to the store.

remove

public void remove(Collection<X509Certificate> certs)
Removes a collection certificates from the store.

Specified by:
remove in interface X509Store
Parameters:
certs - The certificates to remove from the store.

remove

public void remove(String subjectName)
Removes certificates from the store matching the subject name.

Specified by:
remove in interface X509Store
Parameters:
subjectName - The subject name of the certificates to remove.

update

public void update(X509Certificate cert)
Updates an existing certificate in the store with a new representation of the certificate.

Specified by:
update in interface X509Store
Parameters:
cert - Updates an existing certificate in the store.

update

public void update(Collection<X509Certificate> certs)
Updates a collection of existing certificate in the store with a new representations of the certificates.

Specified by:
update in interface X509Store

getAllCertificates

public abstract Collection<X509Certificate> getAllCertificates()
Gets all certificates in the store.

Specified by:
getAllCertificates in interface X509Store
Returns:
A collection of certificates in the store.

getCertificates

public Collection<X509Certificate> getCertificates(javax.mail.internet.InternetAddress address)
Retrieves a collection of certificates for a given InternetAddress.

Specified by:
getCertificates in interface CertificateResolver
Parameters:
address - The InternetAddress used to lookup the certificate.
Returns:
An X509Certificate collection containing the address in its E or CN field.


Copyright © 2010-2015 NHIN Direct. All Rights Reserved.