Class TimeStampReq

Represents the TimeStampReq structure described in RFC3161

Example

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: "1.2.3.4.5.6", certReq: true, nonce: new asn1js.Integer({ valueHex: nonce }), });

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

Hierarchy

Implements

Constructors

Properties

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

Accessors

  • get className(): string
  • Returns string

Methods

  • Parameters

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

    Returns string

  • Compare values with default values for all class members

    Parameters

    • 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

    Returns

    Default value

    Parameters

    • 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

    Returns

    Initialized and filled current class object

    Type Parameters

    Parameters

    • this: PkiObjectConstructor<T>
    • raw: BufferSource

      ASN.1 encoded raw data

    Returns T

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

    Returns

    ASN.1 schema object

    Parameters

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

      Input parameters for the schema

    Returns any

Generated using TypeDoc