import * as asn1js from "asn1js"; import * as pvutils from "pvutils"; import { EMPTY_STRING } from "./constants"; import { AsnError } from "./errors"; import { PkiObject, PkiObjectParameters } from "./PkiObject"; import * as Schema from "./Schema";
// Get internal properties from parsed schema this.templateID = asn1.result.templateID.valueBlock.toString(); if (TEMPLATE_MAJOR_VERSION in asn1.result) { this.templateMajorVersion = asn1.result.templateMajorVersion.valueBlock.valueDec;
} if (TEMPLATE_MINOR_VERSION in asn1.result) { this.templateMinorVersion = asn1.result.templateMinorVersion.valueBlock.valueDec;
}
}
public toSchema(): asn1js.Sequence { // Create array for output sequence const outputArray = [];
outputArray.push(new asn1js.ObjectIdentifier({ value: this.templateID })); if (TEMPLATE_MAJOR_VERSION in this) {
outputArray.push(new asn1js.Integer({ value: this.templateMajorVersion }));
} if (TEMPLATE_MINOR_VERSION in this) {
outputArray.push(new asn1js.Integer({ value: this.templateMinorVersion }));
}
// Construct and return new ASN.1 schema for this object return (new asn1js.Sequence({
value: outputArray
}));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.