All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iaik.x509.CRL

java.lang.Object
   |
   +----iaik.x509.X509Extensions
           |
           +----iaik.x509.CRL

public class CRL
extends X509Extensions
implements ASN1Type
This class represents a X509v2 CertificateRevocationList.


Constructor Index

 o CRL()
Default constructor.
 o CRL(byte[])
Creates a CRL form a PEM or DER byte array.
 o CRL(String)
Creates a CRL form a PEM or DER file.

Method Index

 o addCertificate(RevokedCertificate)
Adds a certificate to the CRL.
 o addCertificate(X509Certificate, Date)
Adds a certificate to the CRL.
 o containsCertificate(BigInteger)
Checks, if the CRL contains a certificate with a serial number.
 o containsCertificate(X509Certificate)
Checks, if the CRL contains a specific certificate.
 o decode(ASN1Object)
Creates a CRL form an ASN1Object.
 o getFingerprint()
Returns the fingerprint of this certificate.
 o getIssuer()
Returns the issuer of this certificate.
 o getNextUpdate()
Returns the date of the next update.
 o getSaveFormat()
Returns the file format (ASN1.DER, ASN1.PEM) of the certificate.
 o getSignatureAlgorithm()
Returns the signature algorithm of this CRL.
 o getThisUpdate()
Returns the date of this update.
 o getVersion()
Returns the version number of this certificate.
 o listCertificates()
Returns an enumeration of the revoked certificates this CRL contains.
 o removeAllCertificates()
Removes all certificates from the CRL.
 o removeCertificate(BigInteger)
Removes the certificate with a given serial number from the CRL.
 o saveToFile(String)
Saves the CRL to a file.
 o setIssuer(Name)
Sets the issuer of this CRL.
 o setNextUpdate(Date)
Sets the date of the next update.
 o setSaveFormat(int)
Sets the file format (ASN1.DER, ASN1.PEM) of the CRL when saving to a file.
 o setSignatureAlgorithm(AlgorithmID)
Sets the signature algorithm for signing this CRL.
 o setSignatureAlgorithm(ObjectID)
Sets the signature algorithm for signing this CRL.
 o setThisUpdate(Date)
Sets the date of this update.
 o setVersion(int)
Sets the version of this CRL.
 o sign(RSAPrivateKey)
Signs the CRL with the private key of the issuer.
 o toASN1Object()
Returns the CRL as an ASN1Object.
 o toByteArray()
Returns the CRL as a DER array.
 o toString()
Returns a string that represents the contents of the certificate.
 o toString(boolean)
Returns a string that represents the contents of the certificate.
 o verify(PublicKey)
Verifies a signed CRL.

Constructors

 o CRL
 public CRL()
Default constructor. Creates an empty object.

 o CRL
 public CRL(String fileName) throws IOException, CRLException
Creates a CRL form a PEM or DER file.

Parameters:
fileName - the file name which contains the CRL
Throws: IOException
if there is a problem with the file
Throws: CRLException
if there is a problem when parsing the CRL
 o CRL
 public CRL(byte crl[]) throws CRLException
Creates a CRL form a PEM or DER byte array.

Parameters:
crl - the byte array which contains the CRL
Throws: CRLException
if there is a problem when parsing the CRL

Methods

 o decode
 public void decode(ASN1Object crl) throws CodingException
Creates a CRL form an ASN1Object.

Parameters:
crl - the ASN1Object which contains the CRL
Throws: CodingException
if there is a problem when parsing the CRL
 o sign
 public void sign(RSAPrivateKey issuerSK) throws CRLException, InvalidKeyException
Signs the CRL with the private key of the issuer.

Parameters:
issuerSK - the private key of the issuer
Throws: CRLException
if the CRL could not be created
Throws: InvalidKeyException
if the private key is not valid
 o verify
 public boolean verify(PublicKey signerPK) throws InvalidKeyException, SignatureException
Verifies a signed CRL.

Parameters:
signerPK - the public key from the signer
Returns:
true if signature OK
Throws: InvalidKeyException
if the private key is invalid
Throws: SignatureException
if the signature object is not initialized properly
 o containsCertificate
 public RevokedCertificate containsCertificate(X509Certificate cert)
Checks, if the CRL contains a specific certificate.

Parameters:
cert - the certificate to check
Returns:
null if the CRL doesn't contain the certificate the RevokedCertificate from the CRL otherwise
 o containsCertificate
 public RevokedCertificate containsCertificate(BigInteger serialNumber)
Checks, if the CRL contains a certificate with a serial number.

Parameters:
serialNumber - the serial number of the certificate
Returns:
null if the CRL doesn't contain a certificate with this serial number the RevokedCertificate from the CRL otherwise
 o toASN1Object
 public ASN1Object toASN1Object()
Returns the CRL as an ASN1Object.

Returns:
the CRL as ASN1Object
 o toByteArray
 public byte[] toByteArray()
Returns the CRL as a DER array.

Returns:
the CRL as DER array
 o saveToFile
 public void saveToFile(String fileName) throws IOException
Saves the CRL to a file.

Parameters:
fileName - the file name to use
Throws: IOException
if there is a problem with the file
 o addCertificate
 public void addCertificate(X509Certificate cert,
                            Date revocationDate)
Adds a certificate to the CRL.

Parameters:
cert - the X509Certificate which should be revoked
revocationDate - the revocation date
 o addCertificate
 public void addCertificate(RevokedCertificate revokedCert)
Adds a certificate to the CRL.

Parameters:
revokedCert - the RevokedCertificate
 o listCertificates
 public Enumeration listCertificates()
Returns an enumeration of the revoked certificates this CRL contains.

Returns:
a list of revoked certificates
 o removeCertificate
 public boolean removeCertificate(BigInteger serialNumber)
Removes the certificate with a given serial number from the CRL.

Parameters:
serialNumber - the serial number of the cert which should be removed
Returns:
true if the cert was removed
 o removeAllCertificates
 public void removeAllCertificates()
Removes all certificates from the CRL.

 o setSaveFormat
 public void setSaveFormat(int format)
Sets the file format (ASN1.DER, ASN1.PEM) of the CRL when saving to a file.

Parameters:
format - the saving format
 o setVersion
 public void setVersion(int crlVersion)
Sets the version of this CRL. If the CRL has extensions the version is automatically set to 2.

Parameters:
crlVersion - the version of this CRL
 o setSignatureAlgorithm
 public void setSignatureAlgorithm(AlgorithmID signatureAlg) throws NoSuchAlgorithmException
Sets the signature algorithm for signing this CRL.

Parameters:
signatureAlg - the AlgorithmID of the signature algorithm
Throws: NoSuchAlgorithmException
if there is no implementation for the specified algorithm
 o setSignatureAlgorithm
 public void setSignatureAlgorithm(ObjectID signatureAlg) throws NoSuchAlgorithmException
Sets the signature algorithm for signing this CRL.

Parameters:
signatureAlg - the ObjectID of the algorithm
Throws: NoSuchAlgorithmException
if there is no implementation for the specified algorithm
 o setIssuer
 public void setIssuer(Name is)
Sets the issuer of this CRL. The issuer is the identity which signs the CRL.

Parameters:
is - the issuer of the CRL
 o setThisUpdate
 public void setThisUpdate(Date thisUpdate)
Sets the date of this update.

Parameters:
thisUpdate - when this CRL was created
 o setNextUpdate
 public void setNextUpdate(Date nextUpdate)
Sets the date of the next update.

Parameters:
nextUpdate - when the next CRL will be created
 o getSaveFormat
 public int getSaveFormat()
Returns the file format (ASN1.DER, ASN1.PEM) of the certificate. Shows the format of the file from which the certificate was read.

Returns:
the safe format
 o getVersion
 public int getVersion()
Returns the version number of this certificate.

Returns:
version number of the certificate
 o getSignatureAlgorithm
 public AlgorithmID getSignatureAlgorithm()
Returns the signature algorithm of this CRL.

Returns:
the signature algorithm used to sign this CRL
 o getIssuer
 public Name getIssuer()
Returns the issuer of this certificate.

Returns:
the issuer of the certificate
 o getThisUpdate
 public Date getThisUpdate()
Returns the date of this update.

Returns:
when this CRL was created
 o getNextUpdate
 public Date getNextUpdate()
Returns the date of the next update.

Returns:
when the next CRL will be created
 o getFingerprint
 public byte[] getFingerprint()
Returns the fingerprint of this certificate. This is a MD5 hash of the DER encoded certificate.

Returns:
the fingerprint of the certificate
 o toString
 public String toString()
Returns a string that represents the contents of the certificate.

Returns:
the string representation
Overrides:
toString in class Object
 o toString
 public String toString(boolean detailed)
Returns a string that represents the contents of the certificate.

Parameters:
detailed - - whether or not to give detailed information about the certificate.
Returns:
the string representation

All Packages  Class Hierarchy  This Package  Previous  Next  Index