Creates a new standard security handler.
Configuration options including passwords and document ID.
The encryption dictionary containing all encryption parameters.
Protected OptionaldocumentDocument identifier for key derivation.
Whether to encrypt document metadata.
Protected OptionalmasterDerived master encryption key.
Protected OptionalownerComputed owner key (O value).
Protected OptionalownerOwner password for full access.
ProtectedpasswordUser password for authentication.
Numeric permission flags.
Protected OptionaluserComputed user key (U value).
ProtectedbuildBuilds the numeric permission flags from a PdfPermissions object.
The permissions to encode.
The numeric permission flags.
Checks if metadata encryption is enabled.
True if metadata should be encrypted.
ProtectedcomputeComputes the master encryption key from the password.
The computed master key.
Computes the object-specific encryption key.
OptionalobjectNumber: numberThe PDF object number.
OptionalgenerationNumber: numberThe PDF generation number.
Optionalalgorithm: PdfEncryptionAlgorithmTypeOptional algorithm type for key derivation.
The computed object key.
ProtectedcomputeComputes the owner key (O value) using RC4-128 algorithm.
The computed owner key.
ProtectedcomputeComputes the user key (U value) using RC4-128 algorithm.
The computed user key.
Decodes the numeric permission flags into a PdfPermissions object.
An object with boolean flags for each permission.
Decrypts data using the appropriate cipher.
The type of content being decrypted.
The encrypted data.
OptionalobjectNumber: numberThe PDF object number.
OptionalgenerationNumber: numberThe PDF generation number.
The decrypted data.
Recursively decrypts all strings and streams within an indirect object.
The indirect object to decrypt.
Encrypts data using the appropriate cipher.
The type of content being encrypted.
The data to encrypt.
OptionalobjectNumber: numberThe PDF object number.
OptionalgenerationNumber: numberThe PDF generation number.
The encrypted data.
Recursively encrypts all strings and streams within an indirect object.
The indirect object to encrypt.
ProtectedgetGets an RC4 cipher for the specified object.
OptionalobjectNumber: numberThe PDF object number.
OptionalgenerationNumber: numberThe PDF generation number.
An RC4 cipher instance.
Gets the encryption key length in bits.
128 for V2 encryption.
Gets the security handler filter name.
'Standard' for password-based encryption.
Gets the encryption revision number.
3 for V2 encryption.
Gets the encryption version number.
2 for 128-bit RC4 encryption.
ProtectedinitInitializes the user and owner keys if not already set.
Checks if the handler is ready (has document ID).
True if document ID is set.
Reads encryption parameters from the encryption dictionary.
The encryption dictionary from the PDF.
Recovers the user password from the owner password.
OptionalownerPassword: string | ByteArrayThe owner password.
The recovered user password as a string.
Sets the master encryption key directly.
The master key to use.
Sets the owner password.
The owner password string or bytes.
Sets the user password.
The user password string or bytes.
V2 security handler implementing 128-bit RC4 encryption. Extends V1 with stronger key length (PDF 1.4).
Example