import type { webcrypto } from "node:crypto"; export type CryptoKey = webcrypto.CryptoKey; export type CryptoKeyPair = webcrypto.CryptoKeyPair; export interface EncryptedKeyEntry { recipientType: "sender" | "receiver"; encryptedKey: string; } export declare const generateAesKey: () => Promise; export declare const generateRsaKeyPair: () => Promise; export declare const exportRsaPublicKey: (publicKey: CryptoKey) => Promise; export declare const importRsaPublicKey: (publicKeyB64: string) => Promise; /** Encrypts bytes; returns IV (12 bytes) || ciphertext+tag — same layout the web app writes. */ export declare const encryptBytes: (data: Uint8Array, key: CryptoKey) => Promise; /** Decrypts IV-prefixed payloads produced by encryptBytes / the web app. */ export declare const decryptBytes: (payload: Uint8Array, key: CryptoKey) => Promise; export declare const encryptSymmetricKey: (symmetricKey: CryptoKey, rsaPublicKey: CryptoKey) => Promise; export declare const decryptSymmetricKey: (encryptedKeyB64: string, rsaPrivateKey: CryptoKey) => Promise; export declare const createBidirectionalEncryptedKeys: (symmetricKey: CryptoKey, senderPublicKey: CryptoKey, receiverPublicKey: CryptoKey) => Promise; export declare const decryptUserSymmetricKey: (entries: EncryptedKeyEntry[], privateKey: CryptoKey, isSender: boolean) => Promise; export declare const randomHex: (byteLength: number) => string;