

import { KnownJwaKeyAgreementAlgorithms, KnownJwaSignatureAlgorithms } from "../../jwa.mjs";
import { ecPublicJwkToPublicKey, ecPublicKeyToPublicJwk } from "./ecPublicKey.mjs";

//#region src/modules/kms/jwk/kty/ec/P256PublicJwk.ts
var P256PublicJwk = class P256PublicJwk {
	constructor(jwk) {
		this.jwk = jwk;
		this.supportdEncryptionKeyAgreementAlgorithms = P256PublicJwk.supportdEncryptionKeyAgreementAlgorithms;
		this.supportedSignatureAlgorithms = P256PublicJwk.supportedSignatureAlgorithms;
		this.multicodecPrefix = P256PublicJwk.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 P256PublicJwk(ecPublicKeyToPublicJwk(publicKey, "P-256"));
	}
	static fromMulticodec(multicodec) {
		return new P256PublicJwk(ecPublicKeyToPublicJwk(multicodec, "P-256"));
	}
};
P256PublicJwk.supportedSignatureAlgorithms = [KnownJwaSignatureAlgorithms.ES256];
P256PublicJwk.supportdEncryptionKeyAgreementAlgorithms = [KnownJwaKeyAgreementAlgorithms.ECDH_ES];
P256PublicJwk.multicodecPrefix = 4608;

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