AbstractCreates 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.
AbstractcomputeComputes 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.
Protected AbstractcomputeComputes the owner key (O value) for the encryption dictionary.
The computed owner key.
Protected AbstractcomputeComputes the user key (U value) for the encryption dictionary.
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.
Protected AbstractgetGets a cipher for the specified object.
OptionalobjectNumber: numberThe PDF object number.
OptionalgenerationNumber: numberThe PDF generation number.
A cipher instance, or null if no encryption needed.
AbstractgetGets the encryption key length in bits.
The key length in bits.
Gets the security handler filter name.
'Standard' for password-based encryption.
AbstractgetGets the encryption revision number.
The revision number.
AbstractgetGets the encryption version number.
The version number (1-5).
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.
AbstractrecoverRecovers the user password from the owner password.
OptionalownerPassword: string | ByteArrayThe owner password.
The recovered user password.
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.
Abstract base class for standard PDF security handlers. Implements password-based encryption as defined in the PDF specification.
Example