anon.crypto
Class CertificateRevocationList

java.lang.Object
  extended by anon.crypto.CertificateRevocationList
All Implemented Interfaces:
IXMLEncodable

public class CertificateRevocationList
extends java.lang.Object
implements IXMLEncodable

This Class implements Certificate Revocation Lists (CRLs) as specified by RFC 5280.

Author:
Robert Hirschberger
See Also:
http://tools.ietf.org/html/rfc5280

Nested Class Summary
private static class CertificateRevocationList.CRLGenerator
          This class is used to generate, sign and modify CRLs.
private static class CertificateRevocationList.CRLInstantiator
           
 
Field Summary
private static java.lang.String BASE64_TAG
           
private  org.bouncycastle.asn1.x509.CertificateList m_crl
           
private  X509Extensions m_extensions
           
private  X509DistinguishedName m_issuer
           
private  java.util.Date m_nextUpdate
           
private  java.util.Date m_thisUpdate
           
private static java.lang.String XML_ELEMENT_NAME
           
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
CertificateRevocationList(org.bouncycastle.asn1.x509.CertificateList a_crl)
          Creates a new instance of CertificateRevocationList from a BC CertificateList
CertificateRevocationList(PKCS12 a_issuerCertificate, java.util.Vector a_certList, java.util.Date a_nextUpdate, X509Extensions a_extensions)
          Creates a new crl.
 
Method Summary
 X509Extensions getExtensions()
           
static CertificateRevocationList getInstance(byte[] a_rawCRL)
          Creates a crl from a byte array
static CertificateRevocationList getInstance(java.io.File a_file)
          Create a crl from a file.
static CertificateRevocationList getInstance(java.io.InputStream a_in)
          Creates a crl by using an input stream.
static java.util.Hashtable getInstance(java.lang.String a_strResourceSearchPath, boolean a_bRecursive, java.lang.String a_ignoreCertMark)
          Method to get instances of CertificateRevocationList from files in the specified path
 X509DistinguishedName getIssuer()
           
 java.util.Date getNextUpdate()
           
 java.util.Vector getRevokedCertificates()
          Creates a vector of RevokedCertificates from the CRLEntries on this crl.
 java.util.Date getThisUpdate()
           
 boolean isIndirectCRL()
           
 byte[] toByteArray()
          Convertes the crl to a byte array.
 byte[] toByteArray(boolean a_Base64Encoded)
          Converts the crl to a byte array.
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Creates XML element of crl consisting of: Base64 encocded crl
 boolean verifiy(JAPCertificate a_cert)
          Verifiy the crl with the given cert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE64_TAG

private static final java.lang.String BASE64_TAG
See Also:
Constant Field Values

XML_ELEMENT_NAME

private static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

m_crl

private org.bouncycastle.asn1.x509.CertificateList m_crl

m_thisUpdate

private java.util.Date m_thisUpdate

m_nextUpdate

private java.util.Date m_nextUpdate

m_issuer

private X509DistinguishedName m_issuer

m_extensions

private X509Extensions m_extensions
Constructor Detail

CertificateRevocationList

public CertificateRevocationList(PKCS12 a_issuerCertificate,
                                 java.util.Vector a_certList,
                                 java.util.Date a_nextUpdate,
                                 X509Extensions a_extensions)
Creates a new crl.

Parameters:
a_issuerCertificate - the crl's issuer
a_certList - the vector of certificates to revoke
a_nextUpdate - the date when the next crl will be published
a_extensions - the extensions for the crl

CertificateRevocationList

public CertificateRevocationList(org.bouncycastle.asn1.x509.CertificateList a_crl)
Creates a new instance of CertificateRevocationList from a BC CertificateList

Parameters:
a_crl - a BC CertificateList
Method Detail

getInstance

public static CertificateRevocationList getInstance(byte[] a_rawCRL)
Creates a crl from a byte array

Parameters:
a_rawCRL - the byte array holding the crl
Returns:
an instance of CertificateRevocationList or null if an error occured

getInstance

public static CertificateRevocationList getInstance(java.io.File a_file)
Create a crl from a file.

Parameters:
a_file - a file containing a crl
Returns:
an instance of CertificateRevocationList or null if an error occured

getInstance

public static CertificateRevocationList getInstance(java.io.InputStream a_in)
Creates a crl by using an input stream.

Parameters:
a_in - Inputstream that holds the crl
Returns:
an instance of CertificateRevocationList or null if an error occured

getInstance

public static java.util.Hashtable getInstance(java.lang.String a_strResourceSearchPath,
                                              boolean a_bRecursive,
                                              java.lang.String a_ignoreCertMark)
Method to get instances of CertificateRevocationList from files in the specified path

Parameters:
a_strResourceSearchPath -
a_bRecursive -
a_ignoreCertMark -
Returns:

getIssuer

public X509DistinguishedName getIssuer()

isIndirectCRL

public boolean isIndirectCRL()

getThisUpdate

public java.util.Date getThisUpdate()

getNextUpdate

public java.util.Date getNextUpdate()

getExtensions

public X509Extensions getExtensions()

getRevokedCertificates

public java.util.Vector getRevokedCertificates()
Creates a vector of RevokedCertificates from the CRLEntries on this crl.

Returns:
a vector of RevokedCertificates

toByteArray

public byte[] toByteArray()
Convertes the crl to a byte array.

Returns:
the crl as a byte array

toByteArray

public byte[] toByteArray(boolean a_Base64Encoded)
Converts the crl to a byte array.

Parameters:
a_Base64Encoded - if the crl is converted to a Base64 encoded form.
Returns:
the crl as a byte array
Throws:
java.io.IOException

verifiy

public boolean verifiy(JAPCertificate a_cert)
Verifiy the crl with the given cert

Parameters:
a_cert - the cert for the verification
Returns:
true if the signature on the crl could be verified with the cert's public key or false otherwise.

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Creates XML element of crl consisting of: Base64 encocded crl

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - The XML document, which is the environment for the created XML element.
Returns:
CRL as XML element.