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

org.bouncycastle.asn1.x509

## Class TBSCertificate

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.x509.TBSCertificate

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class TBSCertificate
      extends ASN1Object

  The TBSCertificate object.

       TBSCertificate ::= SEQUENCE {
            version          [ 0 ]  Version DEFAULT v1(0),
            serialNumber            CertificateSerialNumber,
            signature               AlgorithmIdentifier,
            issuer                  Name,
            validity                Validity,
            subject                 Name,
            subjectPublicKeyInfo    SubjectPublicKeyInfo,
            issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
            subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
            extensions        [ 3 ] Extensions OPTIONAL
            }

  Note: issuerUniqueID and subjectUniqueID are both deprecated by the IETF. This class will parse them, but you really shouldn't be creating new ones.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TBSCertificate(ASN1Integer version, ASN1Integer serialNumber, AlgorithmIdentifier signature, X500Name issuer, Validity validity, X500Name subject, SubjectPublicKeyInfo subjectPublicKeyInfo, ASN1BitString issuerUniqueId, ASN1BitString subjectUniqueId, Extensions extensions)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Time` | `getEndDate()`
    `Extensions` | `getExtensions()`
    `static TBSCertificate` | `getInstance(ASN1TaggedObject obj, boolean explicit)`
    `static TBSCertificate` | `getInstance(java.lang.Object obj)`
    `X500Name` | `getIssuer()`
    `ASN1BitString` | `getIssuerUniqueId()`
    `ASN1Integer` | `getSerialNumber()`
    `AlgorithmIdentifier` | `getSignature()`
    `Time` | `getStartDate()`
    `X500Name` | `getSubject()`
    `SubjectPublicKeyInfo` | `getSubjectPublicKeyInfo()`
    `ASN1BitString` | `getSubjectUniqueId()`
    `Validity` | `getValidity()`
    `ASN1Integer` | `getVersion()`
    `int` | `getVersionNumber()`
    `static java.util.List` | `reviewStructure(ASN1Sequence seq)` Re-run the parse of a candidate tbsCertificate SEQUENCE collecting every problem the strict `getInstance(...)` path would have thrown, instead of stopping at the first.
    `ASN1Primitive` | `toASN1Primitive()` Method providing a primitive representation of this object suitable for encoding.

    - ### 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

    - #### TBSCertificate

          public TBSCertificate(ASN1Integer version,
                                ASN1Integer serialNumber,
                                AlgorithmIdentifier signature,
                                X500Name issuer,
                                Validity validity,
                                X500Name subject,
                                SubjectPublicKeyInfo subjectPublicKeyInfo,
                                ASN1BitString issuerUniqueId,
                                ASN1BitString subjectUniqueId,
                                Extensions extensions)

  - ### Method Detail

    - #### getInstance

          public static TBSCertificate getInstance(ASN1TaggedObject obj,
                                                   boolean explicit)

    - #### getInstance

          public static TBSCertificate getInstance(java.lang.Object obj)

    - #### reviewStructure

          public static java.util.List reviewStructure(ASN1Sequence seq)

      Re-run the parse of a candidate tbsCertificate SEQUENCE collecting every problem the strict `getInstance(...)` path would have thrown, instead of stopping at the first. The strict path and this share one parse method (see `parse(org.bouncycastle.asn1.ASN1Sequence, java.util.List)`); the only difference is the error sink. Intended for diagnostic/reporting tooling (e.g. `org.bouncycastle.cert.X509CertificateReviewer`, github #1508); it does not relax any rule and does not publish a partially-parsed certificate.
      Parameters:
        `seq` - the candidate tbsCertificate SEQUENCE.
      Returns:
        the exceptions the strict path would have thrown, one per problem, in parse order (empty if none).

    - #### getVersionNumber

          public int getVersionNumber()

    - #### getVersion

          public ASN1Integer getVersion()

    - #### getSerialNumber

          public ASN1Integer getSerialNumber()

    - #### getSignature

          public AlgorithmIdentifier getSignature()

    - #### getIssuer

          public X500Name getIssuer()

    - #### getValidity

          public Validity getValidity()

    - #### getStartDate

          public Time getStartDate()

    - #### getEndDate

          public Time getEndDate()

    - #### getSubject

          public X500Name getSubject()

    - #### getSubjectPublicKeyInfo

          public SubjectPublicKeyInfo getSubjectPublicKeyInfo()

    - #### getIssuerUniqueId

          public ASN1BitString getIssuerUniqueId()

    - #### getSubjectUniqueId

          public ASN1BitString getSubjectUniqueId()

    - #### getExtensions

          public Extensions getExtensions()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

      Description copied from class: `ASN1Object`
      Method providing a primitive representation of this object suitable for encoding.
      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a primitive representation of this object.