import * as asn1js from "asn1js"; import { BufferSourceConverter } from "pvtsutils"; import * as pvutils from "pvutils"; import { EMPTY_BUFFER, EMPTY_STRING } from "./constants"; import { ECNamedCurves } from "./ECNamedCurves"; import { ParameterError } from "./errors"; import { PkiObject, PkiObjectParameters } from "./PkiObject"; import * as Schema from "./Schema";
const X = "x"; const Y = "y"; const NAMED_CURVE = "namedCurve";
public fromSchema(schema1: BufferSource): any { //#region Check the schema is valid
const view = BufferSourceConverter.toUint8Array(schema1); if (view[0] !== 0x04) { thrownew Error("Object's schema was not verified against input data for ECPublicKey");
} //#endregion
//#region Get internal properties from parsed schema const namedCurve = ECNamedCurves.find(this.namedCurve); if (!namedCurve) { thrownew Error(`Incorrect curve OID: ${this.namedCurve}`);
} const coordinateLength = namedCurve.size;
if (view.byteLength !== (coordinateLength * 2 + 1)) { thrownew Error("Object's schema was not verified against input data for ECPublicKey");
}
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.