UNPKG

@peculiar/asn1-tsp

Version:

ASN.1 schema for the Time-Stamp Protocol (TSP) defined in RFC 3161.

69 lines (68 loc) 2.06 kB
import { __decorate } from "tslib"; import { AsnIntegerArrayBufferConverter, AsnProp, AsnPropTypes, } from "@peculiar/asn1-schema"; import { Extensions, GeneralName } from "@peculiar/asn1-x509"; import { Accuracy } from "./accuracy.js"; import { MessageImprint } from "./message_imprint.js"; export var TSTInfoVersion; (function (TSTInfoVersion) { TSTInfoVersion[TSTInfoVersion["v1"] = 1] = "v1"; })(TSTInfoVersion || (TSTInfoVersion = {})); export class TSTInfo { version = TSTInfoVersion.v1; policy = ""; messageImprint = new MessageImprint(); serialNumber = new ArrayBuffer(0); genTime = new Date(); accuracy; ordering = false; nonce; tsa; extensions; constructor(params = {}) { Object.assign(this, params); } } __decorate([ AsnProp({ type: AsnPropTypes.Integer }) ], TSTInfo.prototype, "version", void 0); __decorate([ AsnProp({ type: AsnPropTypes.ObjectIdentifier }) ], TSTInfo.prototype, "policy", void 0); __decorate([ AsnProp({ type: MessageImprint }) ], TSTInfo.prototype, "messageImprint", void 0); __decorate([ AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter, }) ], TSTInfo.prototype, "serialNumber", void 0); __decorate([ AsnProp({ type: AsnPropTypes.GeneralizedTime }) ], TSTInfo.prototype, "genTime", void 0); __decorate([ AsnProp({ type: Accuracy, optional: true, }) ], TSTInfo.prototype, "accuracy", void 0); __decorate([ AsnProp({ type: AsnPropTypes.Boolean, defaultValue: false, }) ], TSTInfo.prototype, "ordering", void 0); __decorate([ AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter, optional: true, }) ], TSTInfo.prototype, "nonce", void 0); __decorate([ AsnProp({ type: GeneralName, context: 0, optional: true, }) ], TSTInfo.prototype, "tsa", void 0); __decorate([ AsnProp({ type: Extensions, context: 1, implicit: true, optional: true, }) ], TSTInfo.prototype, "extensions", void 0);