FileDocCategorySizeDatePackage
X509CRL.javaAPI DocAndroid 1.5 API9764Wed May 06 22:41:06 BST 2009java.security.cert

X509CRL

public abstract class X509CRL extends CRL implements X509Extension
Abstract base class for X.509 certificate revocation lists (CRL).

More information regarding CRL can be found in RFC 2459, "Internet X.509 Public Key Infrastructure Certificate and CRL Profile" at http://www.ietf.org/rfc/rfc2459.txt .

since
Android 1.0

Fields Summary
Constructors Summary
protected X509CRL()
Creates a new {@code X509CRL} instance.

since
Android 1.0

        super("X.509"); //$NON-NLS-1$
    
Methods Summary
public booleanequals(java.lang.Object other)
Returns whether the specified object equals to this instance.

param
other the object to compare.
return
{@code true} if the specified object is equal to this, otherwise {@code false}.
since
Android 1.0

        if (other == this) {
            return true;
        }
        if (!(other instanceof X509CRL)) {
            return false;
        }
        X509CRL obj = (X509CRL) other;
        try {
            return Arrays.equals(getEncoded(), obj.getEncoded());
        } catch (CRLException e) {
            return false;
        }
    
public abstract byte[]getEncoded()
Returns this CRL in ASN.1 DER encoded form.

return
this CRL in ASN.1 DER encoded form.
throws
CRLException if encoding fails.
since
Android 1.0

public abstract java.security.PrincipalgetIssuerDN()
Do not use, use {@link #getIssuerX500Principal()} instead. Returns the issuer as an implementation specific Principal object.

return
the issuer distinguished name.
since
Android 1.0

public javax.security.auth.x500.X500PrincipalgetIssuerX500Principal()
Returns the issuer distinguished name of this CRL.

return
the issuer distinguished name of this CRL.
since
Android 1.0

        try {
            // TODO if there is no X.509 certificate provider installed
            // should we try to access Harmony X509CRLImpl via classForName?
            CertificateFactory factory = CertificateFactory
                    .getInstance("X.509"); //$NON-NLS-1$

            X509CRL crl = (X509CRL) factory
                    .generateCRL(new ByteArrayInputStream(getEncoded()));

            return crl.getIssuerX500Principal();

        } catch (Exception e) {
            throw new RuntimeException(Messages.getString("security.59"), e); //$NON-NLS-1$
        }
    
public abstract java.util.DategetNextUpdate()
Returns the {@code nextUpdate} value of this CRL.

return
the {@code nextUpdate} value of this CRL, or {@code null} if none is present.
since
Android 1.0

public abstract java.security.cert.X509CRLEntrygetRevokedCertificate(java.math.BigInteger serialNumber)
Returns the CRL entry with the specified certificate serial number.

param
serialNumber the certificate serial number to search for a CRL entry.
return
the entry for the specified certificate serial number, or {@code null} if not found.
since
Android 1.0

public java.security.cert.X509CRLEntrygetRevokedCertificate(java.security.cert.X509Certificate certificate)
Returns the CRL entry for the specified certificate.

param
certificate the certificate to search a CRL entry for.
return
the entry for the specified certificate, or {@code null} if not found.
since
Android 1.0

        if (certificate == null) {
            throw new NullPointerException();
        }
        return getRevokedCertificate(certificate.getSerialNumber());
    
public abstract java.util.SetgetRevokedCertificates()
Returns the set of revoked certificates.

return
the set of revoked certificates, or {@code null} if no revoked certificates are in this CRL.
since
Android 1.0

public abstract java.lang.StringgetSigAlgName()
Returns the name of the signature algorithm.

return
the name of the signature algorithm.
since
Android 1.0

public abstract java.lang.StringgetSigAlgOID()
Returns the OID of the signature algorithm.

return
the OID of the signature algorithm.
since
Android 1.0

public abstract byte[]getSigAlgParams()
Returns the parameters of the signature algorithm in DER encoded form.

return
the parameters of the signature algorithm in DER encoded form, or {@code null} if not present.
since
Android 1.0

public abstract byte[]getSignature()
Returns the signature bytes of this CRL.

return
the signature bytes of this CRL.
since
Android 1.0

public abstract byte[]getTBSCertList()
Returns the {@code tbsCertList} information of this CRL in DER encoded form.

return
the CRL information in DER encoded form.
throws
CRLException if encoding fails.
since
Android 1.0

public abstract java.util.DategetThisUpdate()
Returns the {@code thisUpdate} value of this CRL.

return
the {@code thisUpdate} value of this CRL.
since
Android 1.0

public abstract intgetVersion()
Returns the version number of this CRL.

return
the version number of this CRL.
since
Android 1.0

public inthashCode()
Returns the hashcode of this CRL instance.

return
the hashcode.
since
Android 1.0

        try {
            int res = 0;
            byte[] array = getEncoded();
            for (int i=0; i<array.length; i++) {
                res += array[i] & 0xFF;
            }
            return res;
        } catch (CRLException e) {
            return 0;
        }
    
public abstract voidverify(java.security.PublicKey key)
Verifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key.

param
key the public key to verify this CRL with.
throws
CRLException if encoding or decoding fails.
throws
NoSuchAlgorithmException if a needed algorithm is not present.
throws
InvalidKeyException if the specified key is invalid.
throws
NoSuchProviderException if no provider can be found.
throws
SignatureException if errors occur on signatures.
since
Android 1.0

public abstract voidverify(java.security.PublicKey key, java.lang.String sigProvider)
Verifies this CRL by verifying that this CRL was signed with the corresponding private key to the specified public key. The signature verification engine of the specified provider will be used.

param
key the public key to verify this CRL with.
param
sigProvider the name of the provider for the signature algorithm.
throws
CRLException if encoding decoding fails.
throws
NoSuchAlgorithmException if a needed algorithm is not present.
throws
InvalidKeyException if the specified key is invalid.
throws
NoSuchProviderException if the specified provider cannot be found.
throws
SignatureException if errors occur on signatures.
since
Android 1.0