Class Index | File Index

Classes


Class KJUR.asn1.tsp.TimeStampResp


Extends KJUR.asn1.ASN1Object.
class for TSP TimeStampResp ASN.1 object
Defined in: asn1tsp-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
class for TSP TimeStampResp ASN.1 object
This is an ASN.1 encoder for TimeStampResp ASN.1 structure defined in RFC 3161 TSP section 2.4.2.
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified, params
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.tsp.TimeStampResp(params)
class for TSP TimeStampResp ASN.1 object
This is an ASN.1 encoder for TimeStampResp ASN.1 structure defined in RFC 3161 TSP section 2.4.2.
TimeStampResp ::= SEQUENCE  {
   status                  PKIStatusInfo,
   timeStampToken          TimeStampToken     OPTIONAL  }

TimeStampToken ::= ContentInfo

TSTInfo ::= SEQUENCE  {
   version           INTEGER  { v1(1) },
   policy            TSAPolicyId,
   messageImprint    MessageImprint,
   serialNumber      INTEGER,
   genTime           GeneralizedTime,
   accuracy          Accuracy                 OPTIONAL,
   ordering          BOOLEAN                  DEFAULT FALSE,
   nonce             INTEGER                  OPTIONAL,
   tsa               [0] GeneralName          OPTIONAL,
   extensions        [1] IMPLICIT Extensions  OPTIONAL  }
The constructor argument "params" can be used all of KJUR.asn1.tsp.TimeStampToken object further more following members can be specified:
// by TimeStampToken parameters (statusinfo will be "granted" by default)
new KJUR.asn1.tsp.TimeStampResp({
  version: 1,
  hashalgs: ["sha256"],
  econtent: {
    type: "tstinfo",
    content: {
      policy: "1.2.3.4.5",
      messageImprint: {alg:"sha256", hash:"12ab..."},
      serial: {"int": 3},
      genTime: {millis: true}, // current time with millis
      accuracy: { millis: 500 }
    }
  }
  certs: [...],
  sinfos: [{
    version: 1,
    id: {type:"isssn", cert: ...},
    hashalg: "sha256",
    sattrs: {array: [{...}]},
    sigalg: "SHA256withRSA",
    signkey: ...
  }]
})
// by TimeStampToken object
new KJUR.asn1.tsp.TimeStampResp({
  tst: new KJUR.asn1.tsp.TimeStapToken(...)
})
// error case
new KJUR.asn1.tsp.TimeStampResp({statusinfo: "rejection"}})
new KJUR.asn1.tsp.TimeStampResp({
   statusinfo: {
     status: "rejection",
     statusstr: ["policy shall be 1.2.3.4.5"],
     failinfo: "unacceptedPolicy"
   }
})
// finally, encode to hexadecimal string
new KJUR.asn1.tsp.TimeStampResp(...).tohex() → "3082..."
Parameters:
{Array} params
associative array of parameters
Since:
jsrsasign 4.6.0 asn1tsp 1.0.0
See:
KJUR.asn1.tsp.TimeStampToken
KJUR.asn1.tsp.PKIStatusInfo

© 2012-2023 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0