anon.crypto
Class RevokedCertifcateStore

java.lang.Object
  extended by anon.crypto.RevokedCertifcateStore

public class RevokedCertifcateStore
extends java.lang.Object

This class holds all valid certificate revocations to check if a certificate is revoked. Implemented as a singleton.

Author:
zenoxx

Field Summary
private static java.lang.String CRL_PATH
          the path from which to load the crls
private static RevokedCertifcateStore m_instance
          the instance of RevokedCertificateStore
private  java.util.Hashtable m_revokedCerts
          This table holds all revocations.
 
Constructor Summary
private RevokedCertifcateStore()
          Create the instance of RevokedCertificateStore.
 
Method Summary
private  void addRevocations(CertificateRevocationList a_crl)
          Adds the revocations of a single crl to the store.
static RevokedCertifcateStore getInstance()
          Returns the instance of RevokedCertificateStore (Singleton).
 java.util.Date getRevocationDate(JAPCertificate a_cert)
          Gets the revocation date for the specified cert, if and only if the cert is revoked.
 boolean isCertificateRevoked(JAPCertificate a_cert)
          Checks if the given cert is revoked.
private static java.lang.String keyValue(JAPCertificate a_cert)
          Creates a concatenation of the certificate's issuer and its (pseudo-)serial.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_instance

private static RevokedCertifcateStore m_instance
the instance of RevokedCertificateStore


CRL_PATH

private static final java.lang.String CRL_PATH
the path from which to load the crls

See Also:
Constant Field Values

m_revokedCerts

private java.util.Hashtable m_revokedCerts
This table holds all revocations. Key is a concatenation of the cert's issuer an its serial Value is an instance of RevokedCertificate

Constructor Detail

RevokedCertifcateStore

private RevokedCertifcateStore()
Create the instance of RevokedCertificateStore. To fill the revocation table the default crls are loaded from a path

Method Detail

addRevocations

private void addRevocations(CertificateRevocationList a_crl)
Adds the revocations of a single crl to the store.

Parameters:
a_crl - the crl to add the revocations from

getInstance

public static RevokedCertifcateStore getInstance()
Returns the instance of RevokedCertificateStore (Singleton). If there is no instance, there is a new one created.

Returns:
the RevokedCertificateStore instance.

keyValue

private static java.lang.String keyValue(JAPCertificate a_cert)
Creates a concatenation of the certificate's issuer and its (pseudo-)serial.

Parameters:
a_cert - the certificate to create the value from
Returns:
the Key value to search the Hashtable
See Also:
RevokedCertificate.getUniqueSerial()

isCertificateRevoked

public boolean isCertificateRevoked(JAPCertificate a_cert)
Checks if the given cert is revoked.

Parameters:
a_cert - the cert to check
Returns:
true if the store contains a revocation for the cert, false otherwise

getRevocationDate

public java.util.Date getRevocationDate(JAPCertificate a_cert)
Gets the revocation date for the specified cert, if and only if the cert is revoked.

Parameters:
a_cert - the cert to get the revocation Date from
Returns:
the revocation date of the cert or null if the store contains no revocation for the cert