import { Cipher } from '../../crypto/types.js'; import { ByteArray } from '../../types.js'; import { PdfV1SecurityHandler } from './v1.js'; /** * V2 security handler implementing 128-bit RC4 encryption. * Extends V1 with stronger key length (PDF 1.4). * * @example * ```typescript * const handler = new PdfV2SecurityHandler({ * password: 'user123', * ownerPassword: 'admin456' * }) * ``` */ export declare class PdfV2SecurityHandler extends PdfV1SecurityHandler { /** * Gets the encryption revision number. * * @returns 3 for V2 encryption. */ getRevision(): number; /** * Gets the encryption version number. * * @returns 2 for 128-bit RC4 encryption. */ getVersion(): number; /** * Gets the encryption key length in bits. * * @returns 128 for V2 encryption. */ getKeyBits(): number; /** * Computes the owner key (O value) using RC4-128 algorithm. * * @returns The computed owner key. */ protected computeOwnerKey(): Promise; /** * Computes the user key (U value) using RC4-128 algorithm. * * @returns The computed user key. * @throws Error if document ID, owner key, or permissions are not set. */ protected computeUserKey(): Promise; /** * Gets an RC4 cipher for the specified object. * * @param objectNumber - The PDF object number. * @param generationNumber - The PDF generation number. * @returns An RC4 cipher instance. */ protected getCipher(objectNumber?: number, generationNumber?: number): Promise; /** * Recovers the user password from the owner password. * * @param ownerPassword - The owner password. * @returns The recovered user password as a string. */ recoverUserPassword(ownerPassword?: ByteArray | string): Promise; }