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
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
Methods
fromSchema()
fromSchema(
schema
):void
Converts parsed ASN.1 object into current class
Parameters
• 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
• encoding: "base64"
| "base64url"
| "hex"
= "hex"
Returns
string
Inherited from
blockName()
static
blockName():string
Returns block name
Returns
string
Returns string block name
Inherited from
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
defaultValues(memberName)
static
defaultValues(memberName
):MessageImprint
Returns default values for all class members
Parameters
• memberName: "messageImprint"
String name for a class member
Returns
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
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
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