import * as asn1js from "asn1js"; import * as pvutils from "pvutils"; import { EMPTY_STRING } from "./constants"; import { AsnError } from "./errors"; import { IssuerAndSerialNumber, IssuerAndSerialNumberJson } from "./IssuerAndSerialNumber"; import { PkiObject, PkiObjectParameters } from "./PkiObject"; import * as Schema from "./Schema";
// Get internal properties from parsed schema if (asn1.result.blockName.idBlock.tagClass === 1) { this.variant = 1; this.value = new IssuerAndSerialNumber({ schema: asn1.result.blockName });
} else { this.variant = 2; this.value = new asn1js.OctetString({ valueHex: asn1.result.blockName.valueBlock.valueHex });
}
}
public toSchema(): asn1js.BaseBlock<any> { // Construct and return new ASN.1 schema for this object switch (this.variant) { case1: if (!(this.value instanceof IssuerAndSerialNumber)) { thrownew Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");
}
return this.value.toSchema(); case2: if (!(this.value instanceof asn1js.OctetString)) { thrownew Error("Incorrect type of RecipientIdentifier.value. It should be ASN.1 OctetString.");
}
return new asn1js.Primitive({
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 0// [0]
},
valueHex: this.value.valueBlock.valueHexView
}); default:
return new asn1js.Any() as any;
}
}
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.