/** * Web Crypto API implementation of the SDK crypto functions. * This is Edge Runtime compatible (works in browsers, Cloudflare Workers, Vercel Edge, etc.) * * These functions mirror the Node.js crypto implementations in ./crypto.ts */ /** * Generates a 128-bit key from the API key using HMAC SHA-256. * Returns the first half (128 bits) of the HMAC digest as a hex string. * * This mirrors the Node.js implementation: * crypto.createHmac('sha256', apiKey).digest('hex').slice(0, 32) * * Note: The Node.js version HMACs an empty message with apiKey as the secret. * * @param apiKey The API key to derive the encryption key from * @returns Promise A 32-character hex string (128 bits) */ export declare function generate128BitKey(apiKey: string): Promise; /** * Decrypts an AES-128-CBC encrypted token. * * The encrypted message format (from the Go backend): * - First 16 bytes: IV (Initialization Vector) * - Remaining bytes: Ciphertext (PKCS7 padded) * * @param key A 32-character hex string (128-bit key from generate128BitKey) * @param encryptedMessage Hex-encoded encrypted message (IV + ciphertext) * @returns Promise The decrypted plaintext */ export declare function decryptAES128BitToken( key: string, encryptedMessage: string, ): Promise;