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
-
↳
TimeStampReq
Implements
Constructors
constructor
• new TimeStampReq(parameters?
): TimeStampReq
Initializes a new instance of the TimeStampReq class
Parameters
Name | Type | Description |
---|---|---|
parameters | TimeStampReqParameters | Initialization parameters |
Returns
Overrides
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
extensions
• Optional
extensions: Extension
[]
The extensions field is a generic way to add additional information to the request in the future.
Implementation of
messageImprint
• messageImprint: MessageImprint
Contains the hash of the datum to be time-stamped
Implementation of
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
reqPolicy
• Optional
reqPolicy: string
Indicates the TSA policy under which the TimeStampToken SHOULD be provided.
Implementation of
version
• version: number
Version of the Time-Stamp request. Should be version 1.
Implementation of
CLASS_NAME
▪ Static
CLASS_NAME: string
= "TimeStampReq"
Name of the class
Overrides
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
Name | Type | Description |
---|---|---|
schema | any | ASN.1 schema |
Returns
void
Overrides
toJSON
▸ toJSON(): TimeStampReqJson
Converts the class to JSON object
Returns
JSON object
Overrides
toSchema
▸ toSchema(): Sequence
Converts current object to ASN.1 object and sets correct values
Returns
Sequence
ASN.1 object
Overrides
toString
▸ toString(encoding?
): string
Parameters
Name | Type | Default value |
---|---|---|
encoding | "base64" | "base64url" | "hex" | "hex" |
Returns
string
Inherited from
blockName
▸ blockName(): string
Returns block name
Returns
string
Returns string block name
Inherited from
compareWithDefault
▸ compareWithDefault(memberName
, memberValue
): boolean
Compare values with default values for all class members
Parameters
Name | Type | Description |
---|---|---|
memberName | string | String name for a class member |
memberValue | any | Value to compare with default value |
Returns
boolean
defaultValues
▸ defaultValues(memberName
): number
Returns default values for all class members
Parameters
Name | Type | Description |
---|---|---|
memberName | "version" | String name for a class member |
Returns
number
Default value