Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FSDK.StdSecurityHandler Class Reference

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

## Static Public Attributes
static | e_ModifyOwnerPassword
| If set, only owner password will be modified during encryption process.
static | e_ModifyPermission
| (Only for AES-256) Enumeration for modify flag used to decide which security data or password will be modified during encryption process More...
static | e_ModifyUserPassword
| If set, user password and owner password will be modified during encryption process.

## Detailed Description

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

See also
  FSDK.SecurityHandler

## Member Function Documentation

## ◆ Initialize()

FSDK.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 FSDK.SecurityHandler.e_CipherNone, or FSDK.SecurityHandler.e_CipherAES with key length 32 (that means not support AES-256). Please refer to comment of class FSDK.StdEncryptData to ensure the validation of each member.

Returns
  true means success, while false means failure.

## ◆ InitializeW()

FSDK.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 FSDK.SecurityHandler.e_CipherAES and key length should be 32.

Returns
  true means success, while false means failure.

## ◆ SetAES256ModifyFlags()

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 FSDK.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 FSDK.StdSecurityHandler.InitializeW. If this function has not been called by current FSDK.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 FSDK.StdSecurityHandler.e_ModifyPermission and this should be one or combination of these values.

Returns
  None.

## Member Data Documentation

## ◆ e_ModifyPermission

FSDK.StdSecurityHandler.e_ModifyPermission
| static

(Only for AES-256) Enumeration for modify flag used to decide which security data or password will be modified during encryption process

Values of this enumeration can be used alone or in combination.

If set, user permissions and "is encrypt metadata" values (which are defined in FSDK.StdEncryptData) will be modified during encryption process.