Class TimeStampReq

Represents the TimeStampReq structure described in RFC3161


The following example demonstrates how to create Time-Stamp Request

```js const nonce = pkijs.getRandomValues(new Uint8Array(10)).buffer;

const tspReq = new pkijs.TimeStampReq({ version: 1, messageImprint: await pkijs.MessageImprint.create("SHA-256", message), reqPolicy: "", certReq: true, nonce: new asn1js.Integer({ valueHex: nonce }), });

const tspReqRaw = tspReq.toSchema().toBER();





certReq?: boolean

If the certReq field is present and set to true, the TSA's public key certificate that is referenced by the ESSCertID identifier inside a SigningCertificate attribute in the response MUST be provided by the TSA in the certificates field from the SignedData structure in that response. That field may also contain other certificates.

If the certReq field is missing or if the certReq field is present and set to false then the certificates field from the SignedData structure MUST not be present in the response.

extensions?: Extension[]

The extensions field is a generic way to add additional information to the request in the future.

messageImprint: MessageImprint

Contains the hash of the datum to be time-stamped

nonce?: Integer

The nonce, if included, allows the client to verify the timeliness of the response when no local clock is available. The nonce is a large random number with a high probability that the client generates it only once.

reqPolicy?: string

Indicates the TSA policy under which the TimeStampToken SHOULD be provided.

version: number

Version of the Time-Stamp request. Should be version 1.

CLASS_NAME: string = "TimeStampReq"

Name of the class


  • get className(): string
  • Returns string


  • Parameters

    • encoding: "base64" | "base64url" | "hex" = "hex"

    Returns string

  • Compare values with default values for all class members


    • memberName: string

      String name for a class member

    • memberValue: any

      Value to compare with default value

    Returns boolean

  • Returns default values for all class members


    Default value


    • memberName: "version"

      String name for a class member

    Returns number

  • Parameters

    • memberName: "messageImprint"

    Returns MessageImprint

  • Parameters

    • memberName: "reqPolicy"

    Returns string

  • Parameters

    • memberName: "nonce"

    Returns Integer

  • Parameters

    • memberName: "certReq"

    Returns boolean

  • Parameters

    • memberName: "extensions"

    Returns Extension[]

  • Creates PKI object from the raw data


    Initialized and filled current class object

    Type Parameters


    • this: PkiObjectConstructor<T>
    • raw: BufferSource

      ASN.1 encoded raw data

    Returns T

  • Returns value of pre-defined ASN.1 schema for current class


    ASN.1 schema object


    • parameters: SchemaParameters<{ certReq?: string; extensions?: string; messageImprint?: MessageImprintSchema; nonce?: string; reqPolicy?: string; version?: string }> = {}

      Input parameters for the schema

    Returns any

Generated using TypeDoc