Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeStampReq

Represents the TimeStampReq structure described in RFC3161

example

The following example demonstrates how to create Time-Stamp Request

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

Index

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

Methods

  • fromSchema(schema: any): void
  • toSchema(): Sequence
  • toString(encoding?: "base64" | "base64url" | "hex"): string
  • blockName(): string
  • compareWithDefault(memberName: string, memberValue: any): boolean
  • 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

  • defaultValues(memberName: "version"): number
  • defaultValues(memberName: "messageImprint"): MessageImprint
  • defaultValues(memberName: "reqPolicy"): string
  • defaultValues(memberName: "nonce"): Integer
  • defaultValues(memberName: "certReq"): boolean
  • defaultValues(memberName: "extensions"): Extension[]
  • fromBER<T>(this: PkiObjectConstructor<T>, raw: BufferSource): T
  • Creates PKI object from the raw data

    Type Parameters

    Parameters

    • this: PkiObjectConstructor<T>
    • raw: BufferSource

      ASN.1 encoded raw data

    Returns T

    Initialized and filled current class object

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

    asn

    ASN.1 schema

    TimeStampReq ::= SEQUENCE  {
       version               INTEGER  { v1(1) },
       messageImprint        MessageImprint,
       reqPolicy             TSAPolicyId              OPTIONAL,
       nonce                 INTEGER                  OPTIONAL,
       certReq               BOOLEAN                  DEFAULT FALSE,
       extensions            [0] IMPLICIT Extensions  OPTIONAL  }
    
    TSAPolicyId ::= OBJECT IDENTIFIER
    

    Parameters

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

      Input parameters for the schema

    Returns any

    ASN.1 schema object

Generated using TypeDoc