type DecryptOptions$1 = { /** * Allowlist of accepted key-management algorithms * (REQUIRED, non-empty). Omitting it raises {@link ErrorCode.MISSING_ALG_ALLOWLIST}. */ alg: string[]; /** * Allowlist of accepted content-encryption * algorithms (REQUIRED, non-empty). */ enc: string[]; /** * Reject larger tokens with * {@link ErrorCode.TOKEN_TOO_LARGE} before doing any crypto. */ maxTokenSize?: number | undefined; /** * `crit` params this caller understands. */ knownCriticalHeaders?: string[] | undefined; /** * Seconds of leeway when enforcing `exp`. */ clockTolerance?: number | undefined; }; type DecryptResult$1 = { protectedHeader: Record; /** * Parsed JSON when the plaintext is JSON, else the raw `Buffer`. */ payload: unknown; }; type KeyInput$1 = any | Buffer | Uint8Array | string | Record; /** * Encrypt into the General JWE JSON serialization. * * @param {unknown} payload * @param {JweRecipientInput[]} recipients * @param {EncryptJsonOptions} options * @returns {Promise} */ declare function encryptJson(payload: unknown, recipients: JweRecipientInput[], options: EncryptJsonOptions): Promise; /** * @typedef {import('./decrypt.js').DecryptOptions} DecryptOptions */ /** * Decrypt a General or Flattened JWE JSON serialization. * * @param {GeneralJwe | Record} jwe * @param {KeyInput} key * @param {DecryptOptions} options * @returns {Promise} */ declare function decryptJson(jwe: GeneralJwe | Record, key: KeyInput, options: DecryptOptions): Promise; type KeyInput = KeyInput$1; type DecryptResult = DecryptResult$1; type JweRecipientInput = { key: KeyInput; /** * Key-management algorithm for this recipient. */ alg: string; kid?: string | undefined; /** * Extra per-recipient header params. */ header?: Record | undefined; apu?: string | Buffer | Uint8Array; apv?: string | Buffer | Uint8Array; }; type EncryptJsonOptions = { /** * Content-encryption algorithm (REQUIRED). */ enc: string; /** * Extra protected-header params. */ header?: Record | undefined; /** * Optional JWE AAD, bound into the tag. */ aad?: string | Buffer | Uint8Array; expiresIn?: string | number | undefined; }; type GeneralJwe = { protected: string; recipients: Array<{ header?: Record; encrypted_key: string; }>; iv: string; ciphertext: string; tag: string; aad?: string | undefined; }; type DecryptOptions = DecryptOptions$1; export { decryptJson, encryptJson }; export type { DecryptOptions, DecryptResult, EncryptJsonOptions, GeneralJwe, JweRecipientInput, KeyInput };