import { Cipher } from '../../crypto/types.js'; import { ByteArray } from '../../types.js'; import { PdfEncryptionAlgorithmType } from '../types.js'; import { PdfStandardSecurityHandler } from './base.js'; /** * V1 security handler implementing 40-bit RC4 encryption. * This is the original PDF encryption format (PDF 1.1). * * @example * ```typescript * const handler = new PdfV1SecurityHandler({ * password: 'user123', * ownerPassword: 'admin456' * }) * ``` */ export declare class PdfV1SecurityHandler extends PdfStandardSecurityHandler { /** * Gets the encryption revision number. * * @returns 2 for V1 encryption. */ getRevision(): number; /** * Gets the encryption version number. * * @returns 1 for 40-bit RC4 encryption. */ getVersion(): number; /** * Gets the encryption key length in bits. * * @returns 40 for V1 encryption. */ getKeyBits(): number; /** * Computes the owner key (O value) using RC4-40 algorithm. * * @returns The computed owner key. */ protected computeOwnerKey(): Promise; /** * Computes the user key (U value) using RC4-40 algorithm. * * @returns The computed user key. * @throws Error if document ID, owner key, or permissions are not set. */ protected computeUserKey(): Promise; /** * Computes the master encryption key from the password. * * @returns The computed master key. * @throws Error if required parameters are missing or password is incorrect. */ protected computeMasterKey(): Promise; /** * Computes the object-specific encryption key. * * @param objectNumber - The PDF object number. * @param generationNumber - The PDF generation number. * @param algorithm - Optional algorithm type for key derivation. * @returns The computed object key. * @throws Error if object or generation number is invalid. */ computeObjectKey(objectNumber?: number, generationNumber?: number, algorithm?: PdfEncryptionAlgorithmType): 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; }