import { AeadAlgorithm } from "./aead.js"; import { KdfAlgorithm } from "./kdf.js"; import { KemAlgorithm } from "./kem.js"; /** @public */ export type PublicKey = CryptoKey & { type: "public"; }; export type SecretKey = CryptoKey & { type: "secret"; }; /** @public */ export type PrivateKey = CryptoKey & { type: "private"; }; /** @public */ export interface HpkeAlgorithm { kem: KemAlgorithm; kdf: KdfAlgorithm; aead: AeadAlgorithm; } export declare function encryptWithLabel(publicKey: PublicKey, label: string, context: Uint8Array, plaintext: Uint8Array, hpke: Hpke): Promise<{ ct: Uint8Array; enc: Uint8Array; }>; export declare function decryptWithLabel(privateKey: PrivateKey, label: string, context: Uint8Array, kemOutput: Uint8Array, ciphertext: Uint8Array, hpke: Hpke): Promise; /** @public */ export interface Hpke { open(privateKey: PrivateKey, kemOutput: Uint8Array, ciphertext: Uint8Array, info: Uint8Array, aad?: Uint8Array): Promise; seal(publicKey: PublicKey, plaintext: Uint8Array, info: Uint8Array, aad?: Uint8Array): Promise<{ ct: Uint8Array; enc: Uint8Array; }>; importPrivateKey(k: Uint8Array): Promise; importPublicKey(k: Uint8Array): Promise; exportPublicKey(k: PublicKey): Promise; exportPrivateKey(k: PrivateKey): Promise; encryptAead(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array | undefined, plaintext: Uint8Array): Promise; decryptAead(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array | undefined, ciphertext: Uint8Array): Promise; exportSecret(publicKey: PublicKey, exporterContext: Uint8Array, length: number, info: Uint8Array): Promise<{ enc: Uint8Array; secret: Uint8Array; }>; importSecret(privateKey: PrivateKey, exporterContext: Uint8Array, kemOutput: Uint8Array, length: number, info: Uint8Array): Promise; deriveKeyPair(ikm: Uint8Array): Promise<{ privateKey: PrivateKey; publicKey: PublicKey; }>; generateKeyPair(): Promise<{ privateKey: PrivateKey; publicKey: PublicKey; }>; keyLength: number; nonceLength: number; }