UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

44 lines (40 loc) • 1.47 kB
import { KnownJwaKeyAgreementAlgorithms, KnownJwaSignatureAlgorithms } from "../../jwa.mjs"; import { ecPublicJwkToPublicKey, ecPublicKeyToPublicJwk } from "./ecPublicKey.mjs"; //#region src/modules/kms/jwk/kty/ec/P521PublicJwk.ts var P521PublicJwk = class P521PublicJwk { constructor(jwk) { this.jwk = jwk; this.supportedEncryptionKeyAgreementAlgorithms = P521PublicJwk.supportedEncryptionKeyAgreementAlgorithms; this.supportedSignatureAlgorithms = P521PublicJwk.supportedSignatureAlgorithms; this.multicodecPrefix = P521PublicJwk.multicodecPrefix; } get publicKey() { return { crv: this.jwk.crv, kty: this.jwk.kty, publicKey: ecPublicJwkToPublicKey(this.jwk) }; } get compressedPublicKey() { return { crv: this.jwk.crv, kty: this.jwk.kty, publicKey: ecPublicJwkToPublicKey(this.jwk, { compressed: true }) }; } get multicodec() { return ecPublicJwkToPublicKey(this.jwk, { compressed: true }); } static fromPublicKey(publicKey) { return new P521PublicJwk(ecPublicKeyToPublicJwk(publicKey, "P-521")); } static fromMulticodec(multicodec) { return new P521PublicJwk(ecPublicKeyToPublicJwk(multicodec, "P-521")); } }; P521PublicJwk.supportedSignatureAlgorithms = [KnownJwaSignatureAlgorithms.ES512]; P521PublicJwk.supportedEncryptionKeyAgreementAlgorithms = [KnownJwaKeyAgreementAlgorithms.ECDH_ES]; P521PublicJwk.multicodecPrefix = 4610; //#endregion export { P521PublicJwk }; //# sourceMappingURL=P521PublicJwk.mjs.map