

import { CredoError } from "../../../../error/CredoError.mjs";
import "../../../../error/index.mjs";
import { X25519PublicJwk } from "../../../kms/jwk/kty/okp/X25519PublicJwk.mjs";
import "../../../kms/index.mjs";
import { VERIFICATION_METHOD_TYPE_JSON_WEB_KEY_2020 } from "../verificationMethod/JsonWebKey2020.mjs";
import { VERIFICATION_METHOD_TYPE_X25519_KEY_AGREEMENT_KEY_2019, getPublicJwkFrommX25519KeyAgreementKey2019, getX25519KeyAgreementKey2019, isX25519KeyAgreementKey2019 } from "../verificationMethod/X25519KeyAgreementKey2019.mjs";
import { VERIFICATION_METHOD_TYPE_MULTIKEY } from "../verificationMethod/Multikey.mjs";
import "../verificationMethod/index.mjs";

//#region src/modules/dids/domain/key-type/x25519.ts
const keyDidX25519 = {
	PublicJwkTypes: [X25519PublicJwk],
	supportedVerificationMethodTypes: [
		VERIFICATION_METHOD_TYPE_X25519_KEY_AGREEMENT_KEY_2019,
		VERIFICATION_METHOD_TYPE_JSON_WEB_KEY_2020,
		VERIFICATION_METHOD_TYPE_MULTIKEY
	],
	getVerificationMethods: (did, publicJwk) => [getX25519KeyAgreementKey2019({
		id: `${did}#${publicJwk.fingerprint}`,
		publicJwk,
		controller: did
	})],
	getPublicJwkFromVerificationMethod: (verificationMethod) => {
		if (isX25519KeyAgreementKey2019(verificationMethod)) return getPublicJwkFrommX25519KeyAgreementKey2019(verificationMethod);
		throw new CredoError(`Verification method with type '${verificationMethod.type}' not supported for key type X25519`);
	}
};

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