CertificateID (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.cert.ocsp

## Class CertificateID

- java.lang.Object
- - org.bouncycastle.cert.ocsp.CertificateID

- Direct Known Subclasses:
    JcaCertificateID

      public class CertificateID
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.bouncycastle.asn1.x509.AlgorithmIdentifier` | `HASH_SHA1`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CertificateID(org.bouncycastle.asn1.ocsp.CertID id)`
    `CertificateID(DigestCalculator digestCalculator, X509CertificateHolder issuerCert, java.math.BigInteger number)` create from an issuer certificate and the serial number of the certificate it signed.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CertificateID` | `deriveCertificateID(CertificateID original, java.math.BigInteger newSerialNumber)` Create a new CertificateID for a new serial number derived from a previous one calculated for the same CA certificate.
    `boolean` | `equals(java.lang.Object o)`
    `org.bouncycastle.asn1.ASN1ObjectIdentifier` | `getHashAlgOID()`
    `byte[]` | `getIssuerKeyHash()`
    `byte[]` | `getIssuerNameHash()`
    `java.math.BigInteger` | `getSerialNumber()` return the serial number for the certificate associated with this request.
    `int` | `hashCode()`
    `boolean` | `matchesIssuer(X509CertificateHolder issuerCert, DigestCalculatorProvider digCalcProvider)`
    `org.bouncycastle.asn1.ocsp.CertID` | `toASN1Object()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HASH_SHA1

          public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier HASH_SHA1

  - ### Constructor Detail

    - #### CertificateID

          public CertificateID(org.bouncycastle.asn1.ocsp.CertID id)

    - #### CertificateID

          public CertificateID(DigestCalculator digestCalculator,
                       X509CertificateHolder issuerCert,
                       java.math.BigInteger number)
                        throws OCSPException

      create from an issuer certificate and the serial number of the certificate it signed.
      Parameters:
        `issuerCert` - issuing certificate
        `number` - serial number
      Throws:
        `OCSPException` - if any problems occur creating the id fields.

  - ### Method Detail

    - #### getHashAlgOID

          public org.bouncycastle.asn1.ASN1ObjectIdentifier getHashAlgOID()

    - #### getIssuerNameHash

          public byte[] getIssuerNameHash()

    - #### getIssuerKeyHash

          public byte[] getIssuerKeyHash()

    - #### getSerialNumber

          public java.math.BigInteger getSerialNumber()

      return the serial number for the certificate associated with this request.

    - #### matchesIssuer

          public boolean matchesIssuer(X509CertificateHolder issuerCert,
                              DigestCalculatorProvider digCalcProvider)
                                throws OCSPException

      Throws:
        `OCSPException`

    - #### toASN1Object

          public org.bouncycastle.asn1.ocsp.CertID toASN1Object()

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### deriveCertificateID

          public static CertificateID deriveCertificateID(CertificateID original,
                                          java.math.BigInteger newSerialNumber)

      Create a new CertificateID for a new serial number derived from a previous one calculated for the same CA certificate.
      Parameters:
        `original` - the previously calculated CertificateID for the CA.
        `newSerialNumber` - the serial number for the new certificate of interest.
      Returns:
        a new CertificateID for newSerialNumber