

const require_CredoError = require('../../../../error/CredoError.js');
require('../../../../error/index.js');
const require_X25519PublicJwk = require('../../../kms/jwk/kty/okp/X25519PublicJwk.js');
require('../../../kms/index.js');
const require_JsonWebKey2020 = require('../verificationMethod/JsonWebKey2020.js');
const require_Multikey = require('../verificationMethod/Multikey.js');
const require_X25519KeyAgreementKey2019 = require('../verificationMethod/X25519KeyAgreementKey2019.js');
require('../verificationMethod/index.js');

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

//#endregion
exports.keyDidX25519 = keyDidX25519;