Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FoxitPDFSDKPython3.StdSecurityHandler Class Reference
Inheritance diagram for FoxitPDFSDKPython3.StdSecurityHandler:

## Public Member Functions
def | StdSecurityHandler ()
| Constructor.
def | StdSecurityHandler (other)
| Constructor, with parent class object. More...
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...
Public Member Functions inherited from FoxitPDFSDKPython3.SecurityHandler
def | SecurityHandler ()
| Constructor.
def | SecurityHandler (other)
| Constructor, with another security handler object. More...
def | GetSecurityType ()
| Get the encryption type of current security handler. More...
def | IsEmpty ()
| Check whether current object is empty or not. More...

## Static Public Attributes
| e_ModifyOwnerPassword = _fsdk.StdSecurityHandler_e_ModifyOwnerPassword
| If set, only owner password will be modified during encryption process.
| e_ModifyPermission = _fsdk.StdSecurityHandler_e_ModifyPermission
| If set, user permissions and "is encrypt metadata" values (which are defined in StdEncryptData ) will be modified during encryption process.
| e_ModifyUserPassword = _fsdk.StdSecurityHandler_e_ModifyUserPassword
| If set, user password and owner password will be modified during encryption process.
Static Public Attributes inherited from FoxitPDFSDKPython3.SecurityHandler
| e_CipherAES = _fsdk.SecurityHandler_e_CipherAES
| Use AES encryption algorithm, with the key length be 16 bytes (as AES-128) or 32 bytes (as AES-256, only supported in PDF 2.0).
| e_CipherNone = _fsdk.SecurityHandler_e_CipherNone
| Not use encryption algorithm.
| e_CipherRC4 = _fsdk.SecurityHandler_e_CipherRC4
| Use RC4 encryption algorithm, with the key length between 5 bytes and 16 bytes.

## Detailed Description

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

See also
  SecurityHandler

## Constructor & Destructor Documentation

## ◆ StdSecurityHandler()

def FoxitPDFSDKPython3.StdSecurityHandler.StdSecurityHandler | ( |  | other | ) |

Constructor, with parent class object.

Parameters

  [in] | other | Parent class object.

## Member Function Documentation

## ◆ Initialize()

def FoxitPDFSDKPython3.StdSecurityHandler.Initialize | ( |  | encrypt_data,
|  |  | user_password,
|  |  | owner_password
| ) |  |

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

Parameters

  [in] | user_password | A user password, which is used to open the PDF document. This can be empty when parameter owner_password is not empty.
  [in] | owner_password | An 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_data | A standard encrypt data object. In the encryption data, cipher type should not be FoxitPDFSDKPython3.SecurityHandler.e_CipherNone , or FoxitPDFSDKPython3.SecurityHandler.e_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 FoxitPDFSDKPython3.StdSecurityHandler.InitializeW | ( |  | encrypt_data,
|  |  | user_password,
|  |  | owner_password
| ) |  |

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

Parameters

  [in] | user_password | A user password, which is used to open the PDF document. This can be empty when parameter owner_password is not empty.
  [in] | owner_password | An 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_data | A standard encrypt data object. In the encryption data, cipher type should be FoxitPDFSDKPython3.SecurityHandler.e_CipherAES and key length should be 32.

Returns
  true means success, while false means failure.

## ◆ SetAES256ModifyFlags()

def FoxitPDFSDKPython3.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_flags | Modify flags used to decide which security data or password will be modified during encryption process. Please refer to values starting from FoxitPDFSDKPython3.StdSecurityHandler.e_ModifyPermission and this should be one or combination of these values.

Returns
  None.