ICustomSecurityHandler

ICustomSecurityHandler

Overview

ICustomSecurityHandler is a interface in Aspose.PDF FOSS for .NET.

Pluggable custom security handler — implement this to handle non-Standard /Filter entries (e.g.

This interface provides 9 methods for working with ICustomSecurityHandler objects in .NET programs. Available methods include: CalculateEncryptionKey, Decrypt, Encrypt, EncryptPermissions, GetOwnerKey, GetUserKey, Initialize, IsOwnerPassword, IsUserPassword. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Filter, KeyLength, Revision, SubFilter, Version.

Properties

NameTypeAccessDescription
FilterstringRead/Filter entry the handler is registered as.
SubFilterstringRead/SubFilter entry the handler is registered as.
VersionintReadAlgorithm version (PDF /Encrypt /V).
RevisionintReadStandard handler revision (PDF /Encrypt /R) reported by the handler for emitted encryption dictionaries.
KeyLengthintReadKey length in bits.

Methods

SignatureDescription
Initialize(parameters: EncryptionParameters)Initialise the handler from parsed /Encrypt parameters.
CalculateEncryptionKey(password: string)Derive the per-document encryption key from the user password.
GetUserKey(userPassword: string)Compute the /U value for the given user password.
GetOwnerKey(userPassword: string, ownerPassword: string)Compute the /O value for the given user/owner password pair.
IsOwnerPassword(password: string)Return true when password matches the owner password.
IsUserPassword(password: string)Return true when password matches the user password.
EncryptPermissions(permissions: int)Encrypt the /Perms byte string for the given permissions (revision 5+).
Encrypt(data: byte[], objectNumber: int, generation: int, key: byte[])Encrypt one PDF object’s content stream / string with the per-object key derived from key + objectNumber + generation.
Decrypt(data: byte[], objectNumber: int, generation: int, key: byte[])Inverse of Encrypt.

See Also