

import { KnownJwaSignatureAlgorithms } from "../../jwa.mjs";
import { okpPublicJwkToPublicKey, okpPublicKeyToPublicJwk } from "./okpPublicKey.mjs";
import { X25519PublicJwk } from "./X25519PublicJwk.mjs";
import { convertPublicKeyToX25519 } from "@stablelib/ed25519";

//#region src/modules/kms/jwk/kty/okp/Ed25519PublicJwk.ts
var Ed25519PublicJwk = class Ed25519PublicJwk {
	constructor(jwk) {
		this.jwk = jwk;
		this.supportdEncryptionKeyAgreementAlgorithms = Ed25519PublicJwk.supportdEncryptionKeyAgreementAlgorithms;
		this.supportedSignatureAlgorithms = Ed25519PublicJwk.supportedSignatureAlgorithms;
		this.multicodecPrefix = Ed25519PublicJwk.multicodecPrefix;
	}
	get publicKey() {
		return {
			crv: this.jwk.crv,
			kty: this.jwk.kty,
			publicKey: okpPublicJwkToPublicKey(this.jwk)
		};
	}
	/**
	* Not supported for Ed25519
	*/
	get compressedPublicKey() {
		return null;
	}
	get multicodec() {
		return okpPublicJwkToPublicKey(this.jwk);
	}
	static fromPublicKey(publicKey) {
		return new Ed25519PublicJwk(okpPublicKeyToPublicJwk(publicKey, "Ed25519"));
	}
	static fromMulticodec(multicodec) {
		return new Ed25519PublicJwk(okpPublicKeyToPublicJwk(multicodec, "Ed25519"));
	}
	toX25519PublicJwk() {
		return X25519PublicJwk.fromPublicKey(convertPublicKeyToX25519(this.publicKey.publicKey)).jwk;
	}
};
Ed25519PublicJwk.supportedSignatureAlgorithms = [KnownJwaSignatureAlgorithms.EdDSA];
Ed25519PublicJwk.supportdEncryptionKeyAgreementAlgorithms = [];
Ed25519PublicJwk.multicodecPrefix = 237;

//#endregion
export { Ed25519PublicJwk };
//# sourceMappingURL=Ed25519PublicJwk.mjs.map