Aspose::Pdf::Security::ICustomSecurityHandler class

ICustomSecurityHandler class

The custom security handler interface.

class ICustomSecurityHandler : public virtual System::Object

Methods

MethodDescription
virtual CalculateEncryptionKey(System::String)Calculate the EncryptionKey. Generally the key is calculated based on the UserKey. You can use values from EncryptionParams, which contains the current parameters at the time of the call. This value is passed as the key argument in Encrypt and Decrypt.
virtual Decrypt(System::ArrayPtr<uint8_t>, int32_t, int32_t, System::ArrayPtr<uint8_t>)Decrypt the data array.
virtual Encrypt(System::ArrayPtr<uint8_t>, int32_t, int32_t, System::ArrayPtr<uint8_t>)Encrypt the data array.
virtual EncryptPermissions(int32_t)Encrypt the document’s permissions field. The result will be written to the Perms encryption dictionary field. When opening a document, the value can be obtained in EncryptionParameters via the Perms field. Allows you to check if the document permissions have changed.
virtual get_Filter()Gets the filter name.
virtual get_KeyLength()Gets the key length.
virtual get_Revision()Gets the handler or encryption algorithm revision.
virtual get_SubFilter()Gets the sub-filter name.
virtual get_Version()Gets the handler or encryption algorithm version.
virtual GetOwnerKey(System::String, System::String)Creates an encoded array based on passwords that will be written to the O field of the encryption dictionary. Should only rely on the arguments passed. The user password can be calculated from this field using the owner password. Called during encryption to prepare it and populate the encryption dictionary. The value will be available in CalculateEncryptionKey to get the key from the UserKey. The passwords specified by the user when calling document encryption will be passed. Passwords may not be specified or only one may be specified.
virtual GetUserKey(System::String)Creates an encoded array based on the user’s password. This value is typically used to check if the password belongs to the user or owner, and to get the encryption key. Called during encryption to prepare it and populate the encryption dict. The user-specified password is passed as an argument when calling document encryption.
virtual Initialize(System::SharedPtr<EncryptionParameters>)Called to initialize the current instance for encryption. Note that when encrypting, it will be filled with the data of the transferred properties ICustomSecurityHandler, and when opening the document from the encryption dictionary. If the method is called during new encryption, then EncryptionParameters::UserKey and EncryptionParameters::OwnerKey will be null.
virtual IsOwnerPassword(System::String)Check if the password is the document owner’s password. The method is called after Initialize. The method call is used in the PDF API.
virtual IsUserPassword(System::String)Check if the password belongs to the user (password for opening the document). The method is called after Initialize. The method call is used in the PDF API.

See Also