OOBCertHash (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.asn1.cmp

## Class OOBCertHash

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.cmp.OOBCertHash

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class OOBCertHash
      extends ASN1Object

       OOBCertHash ::= SEQUENCE {
       hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
       certId      [1] CertId                  OPTIONAL,
       hashVal         BIT STRING
       -- hashVal is calculated over the DER encoding of the
       -- self-signed certificate with the identifier certID.
       }

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OOBCertHash(AlgorithmIdentifier hashAlg, CertId certId, byte[] hashVal)`
    `OOBCertHash(AlgorithmIdentifier hashAlg, CertId certId, DERBitString hashVal)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CertId` | `getCertId()`
    `AlgorithmIdentifier` | `getHashAlg()`
    `ASN1BitString` | `getHashVal()`
    `static OOBCertHash` | `getInstance(java.lang.Object o)`
    `ASN1Primitive` | `toASN1Primitive()` OOBCertHash ::= SEQUENCE { hashAlg [0] AlgorithmIdentifier OPTIONAL, certId [1] CertId OPTIONAL, hashVal BIT STRING -- hashVal is calculated over the DER encoding of the -- self-signed certificate with the identifier certID. }

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode`

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

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

- - ### Constructor Detail

    - #### OOBCertHash

          public OOBCertHash(AlgorithmIdentifier hashAlg,
                             CertId certId,
                             byte[] hashVal)

    - #### OOBCertHash

          public OOBCertHash(AlgorithmIdentifier hashAlg,
                             CertId certId,
                             DERBitString hashVal)

  - ### Method Detail

    - #### getInstance

          public static OOBCertHash getInstance(java.lang.Object o)

    - #### getHashAlg

          public AlgorithmIdentifier getHashAlg()

    - #### getCertId

          public CertId getCertId()

    - #### getHashVal

          public ASN1BitString getHashVal()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

           OOBCertHash ::= SEQUENCE {
                                hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
                                certId      [1] CertId                  OPTIONAL,
                                hashVal         BIT STRING
                                -- hashVal is calculated over the DER encoding of the
                                -- self-signed certificate with the identifier certID.
                 }

      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a basic ASN.1 object representation.