UNPKG

verifiablecredentials-crypto-sdk-typescript-keys

Version:
31 lines 1.27 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const KeyTypeFactory_1 = require("../KeyTypeFactory"); const JsonWebKey_1 = __importDefault(require("../JsonWebKey")); const base64url_1 = __importDefault(require("base64url")); /** * Represents an Elliptic Curve public key (Edward curve) * @class * @extends PublicKey */ class OkpPublicKey extends JsonWebKey_1.default { /** * Create instance of @class EcPublicKey */ constructor(key) { super(key); this.crv = key.crv; this.x = typeof key.x === 'string' ? key.x : base64url_1.default.encode(key.x); this.alg = key.alg; this.kty = KeyTypeFactory_1.KeyType.OKP; } } exports.default = OkpPublicKey; //# sourceMappingURL=OkpPublicKey.js.map