PKI-Lite - v1.0.12
    Preparing search index...

    TSTInfo structure for RFC 3161 Time-Stamp Protocol.

    The TSTInfo is the core content of a timestamp token. It contains the actual timestamp along with the hashed data and policy information. This structure is encapsulated within a SignedData content type.

    TSTInfo ::= SEQUENCE  {
        version                      INTEGER  { v1(1) },
        policy                       TSAPolicyId,
        messageImprint               MessageImprint,
          -- MUST have the same value as the similar field in
          -- TimeStampReq
        serialNumber                 INTEGER,
         -- Time-Stamping users MUST be ready to accommodate integers
         -- up to 160 bits.
        genTime                      GeneralizedTime,
        accuracy                     Accuracy                 OPTIONAL,
        ordering                     BOOLEAN             DEFAULT FALSE,
        nonce                        INTEGER                  OPTIONAL,
          -- MUST be present if the similar field was present
          -- in TimeStampReq.  In that case it MUST have the same value.
        tsa                          [0] GeneralName          OPTIONAL,
        extensions                   [1] IMPLICIT Extensions  OPTIONAL   }
    
    TSAPolicyId ::= OBJECT IDENTIFIER
    

    RFC 3161 Section 2.4.2 - TSTInfo Structure

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new TSTInfo instance.

      Parameters

      • options: {
            accuracy?: Accuracy;
            extensions?: Extension[];
            genTime: Date;
            messageImprint: MessageImprint;
            nonce?: Uint8Array<ArrayBuffer>;
            ordering?: boolean;
            policy: ObjectIdentifierString;
            serialNumber: Uint8Array<ArrayBuffer>;
            tsa?: GeneralName;
            version?: number;
        }

        Configuration object for the timestamp info

        • Optionalaccuracy?: Accuracy

          Optional accuracy specification

        • Optionalextensions?: Extension[]

          Optional extensions

        • genTime: Date

          Generation time of the timestamp

        • messageImprint: MessageImprint

          Hash imprint that was timestamped

        • Optionalnonce?: Uint8Array<ArrayBuffer>

          Optional nonce (must match request if present)

        • Optionalordering?: boolean

          Whether timestamps are ordered

        • policy: ObjectIdentifierString

          TSA policy OID

        • serialNumber: Uint8Array<ArrayBuffer>

          Unique serial number (up to 160 bits)

        • Optionaltsa?: GeneralName

          Optional TSA identity

        • Optionalversion?: number

          Protocol version, defaults to 1

      Returns TSTInfo

      const tstInfo = new TSTInfo({
      policy: "1.3.6.1.4.1.123.456.1",
      messageImprint: messageImprint,
      serialNumber: new Uint8Array([1, 2, 3, 4]),
      genTime: new Date(),
      accuracy: new Accuracy({ seconds: 1 }),
      ordering: false
      })

    Properties

    accuracy?: Accuracy

    Optional accuracy of the timestamp

    extensions?: Extension[]

    Optional extensions

    genTime: Date

    Time at which the timestamp was generated

    messageImprint: MessageImprint

    Hash of the data that was timestamped

    nonce?: Uint8Array<ArrayBuffer>

    Optional nonce from the request

    ordering: boolean = false

    Whether timestamps are ordered (default false)

    TSA policy under which the timestamp was issued

    serialNumber: Uint8Array<ArrayBuffer>

    Unique serial number for this timestamp

    Optional TSA identity

    version: number

    Version of the TSTInfo format, currently always 1

    Accessors

    • get pemHeader(): string

      Gets the PEM header name for this object type. Converts the class name to uppercase for use in PEM encoding.

      Returns string

    • get pkiType(): string

      Gets the PKI type name for this object (typically the class name). Used for PEM headers and debugging output.

      Returns string

    Methods

    • Compares this PKI object with another for equality. Two objects are considered equal if their DER encodings are identical.

      Parameters

      • other: PkiBase<any>

        The other PKI object to compare with

      Returns boolean

      true if the objects are equal, false otherwise

    • Returns a human-readable string representation of this object. By default, returns the same as toString(), but subclasses can override for more user-friendly output.

      Returns string

      A human-readable string representation

    • Creates a TSTInfo from an ASN.1 structure.

      Parses the ASN.1 SEQUENCE and extracts all optional and required fields according to RFC 3161 specification.

      Parameters

      Returns TSTInfo

      The parsed TSTInfo object

      Asn1ParseError if the ASN.1 structure is invalid

      const asn1 = derToAsn1(tstInfoBytes)
      const tstInfo = TSTInfo.fromAsn1(asn1)
      console.log(tstInfo.genTime)
      console.log(tstInfo.messageImprint.hashAlgorithm)