Foxit PDF SDK
fsdk.StdSecurityHandler Class Reference

Public Member Functions

def Initialize (encrypt_data, user_password, owner_password)
 (Not support AES-256) Initialize current standard security handler. More...
 
def InitializeW (encrypt_data, user_password, owner_password)
 (Only for AES-256) Initialize current standard security handler. More...
 
def SetAES256ModifyFlags (modify_flags)
 (Only for AES-256) Set modify flags to decide which security data or password will be modified during encryption process. More...
 

Detailed Description

This class represents a standard security handler, used for password encryption.

See also
SecurityHandler

Member Function Documentation

◆ Initialize()

def fsdk.StdSecurityHandler.Initialize (   encrypt_data,
  user_password,
  owner_password 
)

(Not support AES-256) Initialize current standard security handler.

Parameters
[in]user_passwordA user password, which is used to open the PDF document. This can be empty when parameter owner_password is not empty.
[in]owner_passwordAn owner password, which is used to take ownership of the PDF document. This can be empty when parameter user_password is not empty.
[in]encrypt_dataA standard encrypt data object. In the encryption data, cipher type should not be fsdk.SecurityHandlerE_CipherNone , or fsdk.SecurityHandlerE_CipherAES with key length 32 (that means not support AES-256). Please refer to comment of class StdEncryptData to ensure the validation of each member.
Returns
true means success, while false means failure.

◆ InitializeW()

def fsdk.StdSecurityHandler.InitializeW (   encrypt_data,
  user_password,
  owner_password 
)

(Only for AES-256) Initialize current standard security handler.

Parameters
[in]user_passwordA user password, which is used to open the PDF document. This can be empty when parameter owner_password is not empty.
[in]owner_passwordAn owner password, which is used to take ownership of the PDF document. This can be empty when parameter user_password is not empty.
[in]encrypt_dataA standard encrypt data object. In the encryption data, cipher type should be fsdk.SecurityHandlerE_CipherAES and key length should be 32.
Returns
true means success, while false means failure.

◆ SetAES256ModifyFlags()

def fsdk.StdSecurityHandler.SetAES256ModifyFlags (   modify_flags)

(Only for AES-256) Set modify flags to decide which security data or password will be modified during encryption process.

Modify flags are useful only when a PDF document has been encrypted by AES-256 and current StdSecurityHandler object is to be used to modify some security data or password for this PDF document. For other case, these modify flags will be ignored during encryption process. Security data and passwords are set through function StdSecurityHandler::InitializeW. If this function has not been called by current StdSecurityHandler object, that means to modify all the security data and password by default.

Parameters
[in]modify_flagsModify flags used to decide which security data or password will be modified during encryption process. Please refer to values starting from fsdk.StdSecurityHandlerE_ModifyPermission and this should be one or combination of these values.
Returns
None.