Skip to main content

TimeStampReq

Represents the TimeStampReq structure described in RFC3161

Example

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();

Extends

Implements

Constructors

new TimeStampReq()

new TimeStampReq(parameters): TimeStampReq

Initializes a new instance of the TimeStampReq class

Parameters

parameters: TimeStampReqParameters = {}

Initialization parameters

Returns

TimeStampReq

Overrides

PkiObject.constructor

Properties

certReq?

optional 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.

Implementation of

ITimeStampReq.certReq


extensions?

optional extensions: Extension[]

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

Implementation of

ITimeStampReq.extensions


messageImprint

messageImprint: MessageImprint

Contains the hash of the datum to be time-stamped

Implementation of

ITimeStampReq.messageImprint


nonce?

optional 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.

Implementation of

ITimeStampReq.nonce


reqPolicy?

optional reqPolicy: string

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

Implementation of

ITimeStampReq.reqPolicy


version

version: number

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

Implementation of

ITimeStampReq.version


CLASS_NAME

static CLASS_NAME: string = "TimeStampReq"

Name of the class

Overrides

PkiObject.CLASS_NAME

Accessors

className

get className(): string

Returns

string

Inherited from

PkiObject.className

Methods

fromSchema()

fromSchema(schema): void

Converts parsed ASN.1 object into current class

Parameters

schema: any

ASN.1 schema

Returns

void

Overrides

PkiObject.fromSchema


toJSON()

toJSON(): TimeStampReqJson

Converts the class to JSON object

Returns

TimeStampReqJson

JSON object

Overrides

PkiObject.toJSON


toSchema()

toSchema(): Sequence

Converts current object to ASN.1 object and sets correct values

Returns

Sequence

ASN.1 object

Overrides

PkiObject.toSchema


toString()

toString(encoding): string

Parameters

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

Returns

string

Inherited from

PkiObject.toString


blockName()

static blockName(): string

Returns block name

Returns

string

Returns string block name

Inherited from

PkiObject.blockName


compareWithDefault()

static compareWithDefault(memberName, memberValue): 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()

defaultValues(memberName)

static defaultValues(memberName): number

Returns default values for all class members

Parameters

memberName: "version"

String name for a class member

Returns

number

Default value

Overrides

PkiObject.defaultValues

defaultValues(memberName)

static defaultValues(memberName): MessageImprint

Returns default values for all class members

Parameters

memberName: "messageImprint"

String name for a class member

Returns

MessageImprint

Default value

Overrides

PkiObject.defaultValues

defaultValues(memberName)

static defaultValues(memberName): string

Returns default values for all class members

Parameters

memberName: "reqPolicy"

String name for a class member

Returns

string

Default value

Overrides

PkiObject.defaultValues

defaultValues(memberName)

static defaultValues(memberName): Integer

Returns default values for all class members

Parameters

memberName: "nonce"

String name for a class member

Returns

Integer

Default value

Overrides

PkiObject.defaultValues

defaultValues(memberName)

static defaultValues(memberName): boolean

Returns default values for all class members

Parameters

memberName: "certReq"

String name for a class member

Returns

boolean

Default value

Overrides

PkiObject.defaultValues

defaultValues(memberName)

static defaultValues(memberName): Extension[]

Returns default values for all class members

Parameters

memberName: "extensions"

String name for a class member

Returns

Extension[]

Default value

Overrides

PkiObject.defaultValues


fromBER()

static fromBER<T>(this, raw): T

Creates PKI object from the raw data

Type Parameters

T extends PkiObject

Parameters

this: PkiObjectConstructor<T>

raw: BufferSource

ASN.1 encoded raw data

Returns

T

Initialized and filled current class object

Inherited from

PkiObject.fromBER


schema()

static schema(parameters): any

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

Parameters

parameters: SchemaParameters<object> = {}

Input parameters for the schema

Returns

any

ASN.1 schema object

Overrides

PkiObject.schema