@peculiar/asn1-tsp
Version:
Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP)
55 lines (54 loc) • 1.99 kB
JavaScript
import { __decorate } from "tslib";
import { AsnIntegerArrayBufferConverter, AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { Extensions, GeneralName } from "@peculiar/asn1-x509";
import { Accuracy } from "./accuracy";
import { MessageImprint } from "./message_imprint";
export var TSTInfoVersion;
(function (TSTInfoVersion) {
TSTInfoVersion[TSTInfoVersion["v1"] = 1] = "v1";
})(TSTInfoVersion || (TSTInfoVersion = {}));
export class TSTInfo {
constructor(params = {}) {
this.version = TSTInfoVersion.v1;
this.policy = "";
this.messageImprint = new MessageImprint();
this.serialNumber = new ArrayBuffer(0);
this.genTime = new Date();
this.ordering = false;
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);