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.
-
CRL()
- Default constructor.
-
CRL(byte[])
- Creates a CRL form a PEM or DER byte array.
-
CRL(String)
- Creates a CRL form a PEM or DER file.
-
addCertificate(RevokedCertificate)
- Adds a certificate to the CRL.
-
addCertificate(X509Certificate, Date)
- Adds a certificate to the CRL.
-
containsCertificate(BigInteger)
- Checks, if the CRL contains a certificate with a serial number.
-
containsCertificate(X509Certificate)
- Checks, if the CRL contains a specific certificate.
-
decode(ASN1Object)
- Creates a CRL form an ASN1Object.
-
getFingerprint()
- Returns the fingerprint of this certificate.
-
getIssuer()
- Returns the issuer of this certificate.
-
getNextUpdate()
- Returns the date of the next update.
-
getSaveFormat()
- Returns the file format (ASN1.DER, ASN1.PEM) of the certificate.
-
getSignatureAlgorithm()
- Returns the signature algorithm of this CRL.
-
getThisUpdate()
- Returns the date of this update.
-
getVersion()
- Returns the version number of this certificate.
-
listCertificates()
- Returns an enumeration of the revoked certificates this CRL contains.
-
removeAllCertificates()
- Removes all certificates from the CRL.
-
removeCertificate(BigInteger)
- Removes the certificate with a given serial number from the CRL.
-
saveToFile(String)
- Saves the CRL to a file.
-
setIssuer(Name)
- Sets the issuer of this CRL.
-
setNextUpdate(Date)
- Sets the date of the next update.
-
setSaveFormat(int)
- Sets the file format (ASN1.DER, ASN1.PEM) of the CRL when saving to a file.
-
setSignatureAlgorithm(AlgorithmID)
- Sets the signature algorithm for signing this CRL.
-
setSignatureAlgorithm(ObjectID)
- Sets the signature algorithm for signing this CRL.
-
setThisUpdate(Date)
- Sets the date of this update.
-
setVersion(int)
- Sets the version of this CRL.
-
sign(RSAPrivateKey)
- Signs the CRL with the private key of the issuer.
-
toASN1Object()
- Returns the CRL as an ASN1Object.
-
toByteArray()
- Returns the CRL as a DER array.
-
toString()
- Returns a string that represents the contents of the certificate.
-
toString(boolean)
- Returns a string that represents the contents of the certificate.
-
verify(PublicKey)
- Verifies a signed CRL.
CRL
public CRL()
- Default constructor. Creates an empty object.
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
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
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
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
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
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
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
toASN1Object
public ASN1Object toASN1Object()
- Returns the CRL as an ASN1Object.
- Returns:
- the CRL as ASN1Object
toByteArray
public byte[] toByteArray()
- Returns the CRL as a DER array.
- Returns:
- the CRL as DER array
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
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
addCertificate
public void addCertificate(RevokedCertificate revokedCert)
- Adds a certificate to the CRL.
- Parameters:
- revokedCert - the RevokedCertificate
listCertificates
public Enumeration listCertificates()
- Returns an enumeration of the revoked certificates this CRL contains.
- Returns:
- a list of revoked certificates
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
removeAllCertificates
public void removeAllCertificates()
- Removes all certificates from the CRL.
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
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
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
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
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
setThisUpdate
public void setThisUpdate(Date thisUpdate)
- Sets the date of this update.
- Parameters:
- thisUpdate - when this CRL was created
setNextUpdate
public void setNextUpdate(Date nextUpdate)
- Sets the date of the next update.
- Parameters:
- nextUpdate - when the next CRL will be created
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
getVersion
public int getVersion()
- Returns the version number of this certificate.
- Returns:
- version number of the certificate
getSignatureAlgorithm
public AlgorithmID getSignatureAlgorithm()
- Returns the signature algorithm of this CRL.
- Returns:
- the signature algorithm used to sign this CRL
getIssuer
public Name getIssuer()
- Returns the issuer of this certificate.
- Returns:
- the issuer of the certificate
getThisUpdate
public Date getThisUpdate()
- Returns the date of this update.
- Returns:
- when this CRL was created
getNextUpdate
public Date getNextUpdate()
- Returns the date of the next update.
- Returns:
- when the next CRL will be created
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
toString
public String toString()
- Returns a string that represents the contents of the certificate.
- Returns:
- the string representation
- Overrides:
- toString in class Object
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