@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
42 lines (41 loc) • 1.39 kB
JavaScript
import { KnownJwaKeyAgreementAlgorithms } from "../../jwa.mjs";
import { okpPublicJwkToPublicKey, okpPublicKeyToPublicJwk } from "./okpPublicKey.mjs";
//#region src/modules/kms/jwk/kty/okp/X25519PublicJwk.ts
var X25519PublicJwk = class X25519PublicJwk {
constructor(jwk) {
this.jwk = jwk;
this.supportedEncryptionKeyAgreementAlgorithms = X25519PublicJwk.supportedEncryptionKeyAgreementAlgorithms;
this.supportedSignatureAlgorithms = X25519PublicJwk.supportedSignatureAlgorithms;
this.multicodecPrefix = X25519PublicJwk.multicodecPrefix;
}
get publicKey() {
return {
crv: this.jwk.crv,
kty: this.jwk.kty,
publicKey: okpPublicJwkToPublicKey(this.jwk)
};
}
/**
* Not supported for X25519
*/
get compressedPublicKey() {
return null;
}
get multicodec() {
return okpPublicJwkToPublicKey(this.jwk);
}
static fromPublicKey(publicKey) {
const jwk = okpPublicKeyToPublicJwk(publicKey, "X25519");
return new X25519PublicJwk(jwk);
}
static fromMulticodec(multicodec) {
const jwk = okpPublicKeyToPublicJwk(multicodec, "X25519");
return new X25519PublicJwk(jwk);
}
};
X25519PublicJwk.supportedEncryptionKeyAgreementAlgorithms = [KnownJwaKeyAgreementAlgorithms.ECDH_HSALSA20];
X25519PublicJwk.supportedSignatureAlgorithms = [];
X25519PublicJwk.multicodecPrefix = 236;
//#endregion
export { X25519PublicJwk };
//# sourceMappingURL=X25519PublicJwk.mjs.map