pdf-lite - v1.0.1
    Preparing search index...

    V2 security handler implementing 128-bit RC4 encryption. Extends V1 with stronger key length (PDF 1.4).

    const handler = new PdfV2SecurityHandler({
    password: 'user123',
    ownerPassword: 'admin456'
    })

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The encryption dictionary containing all encryption parameters.

    documentId?: PdfId

    Document identifier for key derivation.

    encryptMetadata: boolean

    Whether to encrypt document metadata.

    masterKey?: ByteArray

    Derived master encryption key.

    ownerKey?: ByteArray

    Computed owner key (O value).

    ownerPassword?: ByteArray

    Owner password for full access.

    password: ByteArray

    User password for authentication.

    permissions: number

    Numeric permission flags.

    userKey?: ByteArray

    Computed user key (U value).

    Methods

    • Decrypts data using the appropriate cipher.

      Parameters

      • type: "string" | "stream" | "file"

        The type of content being decrypted.

      • data: ByteArray

        The encrypted data.

      • OptionalobjectNumber: number

        The PDF object number.

      • OptionalgenerationNumber: number

        The PDF generation number.

      Returns Promise<ByteArray>

      The decrypted data.

    • Encrypts data using the appropriate cipher.

      Parameters

      • type: "string" | "stream" | "file"

        The type of content being encrypted.

      • data: ByteArray

        The data to encrypt.

      • OptionalobjectNumber: number

        The PDF object number.

      • OptionalgenerationNumber: number

        The PDF generation number.

      Returns Promise<ByteArray>

      The encrypted data.