import type { AsymmetricKeyGenerator } from '../types/key-generator.js'; import type { Jwk } from '../jose/jwk.js'; import type { KeyConverter } from '../types/key-converter.js'; import type { BytesToPrivateKeyParams, ComputePublicKeyParams, GenerateKeyParams, GetPublicKeyParams, PrivateKeyToBytesParams } from '../types/params-direct.js'; import { CryptoAlgorithm } from './crypto-algorithm.js'; /** * The `X25519GenerateKeyParams` interface defines the algorithm-specific parameters that should be * passed into the `generateKey()` method when using the X25519 key agreement algorithm. */ export interface X25519GenerateKeyParams extends GenerateKeyParams { /** * A string defining the type of key to generate. The value must be: * - `"X25519"`: Elliptic-curve Diffie-Hellman (ECDH) using Curve25519. */ algorithm: 'X25519'; } /** * The `X25519Algorithm` class provides a concrete implementation for key generation, * public key derivation, and key conversion using the X25519 elliptic curve. X25519 is a * key agreement curve (not a signature curve) used for ECDH key exchange in JWE encryption. * * This class implements the {@link AsymmetricKeyGenerator | `AsymmetricKeyGenerator`} and * {@link KeyConverter | `KeyConverter`} interfaces, providing private key generation, * public key derivation, and byte/JWK conversion. */ export declare class X25519Algorithm extends CryptoAlgorithm implements AsymmetricKeyGenerator, KeyConverter { /** * Converts a raw private key in bytes to its corresponding JWK format. * * @param params - The parameters for the private key conversion. * @param params.algorithm - Must be `'X25519'`. * @param params.privateKeyBytes - The raw private key as a Uint8Array. * * @returns A Promise that resolves to the private key in JWK format. */ bytesToPrivateKey({ algorithm, privateKeyBytes }: BytesToPrivateKeyParams & { algorithm: 'X25519'; }): Promise; /** * Derives the public key in JWK format from a given X25519 private key. * * @param params - The parameters for the public key derivation. * @param params.key - The private key in JWK format from which to derive the public key. * * @returns A Promise that resolves to the derived public key in JWK format. */ computePublicKey({ key }: ComputePublicKeyParams): Promise; /** * Generates a new X25519 private key in JWK format. * * @param params - The parameters for key generation. * @param params.algorithm - Must be `'X25519'`. * * @returns A Promise that resolves to the generated private key in JWK format. */ generateKey({ algorithm }: X25519GenerateKeyParams): Promise; /** * Retrieves the public key properties from a given X25519 private key in JWK format. * * @param params - The parameters for retrieving the public key properties. * @param params.key - The private key in JWK format. * * @returns A Promise that resolves to the public key in JWK format. */ getPublicKey({ key }: GetPublicKeyParams): Promise; /** * Converts a private key from JWK format to a byte array. * * @param params - The parameters for the private key conversion. * @param params.privateKey - The private key in JWK format. * * @returns A Promise that resolves to the private key as a Uint8Array. */ privateKeyToBytes({ privateKey }: PrivateKeyToBytesParams): Promise; } //# sourceMappingURL=x25519.d.ts.map