Foxit PDF SDK

Public Member Functions | List of all members
FoxitPDFSDKPython2.DRMSecurityCallback Class Reference
Inheritance diagram for FoxitPDFSDKPython2.DRMSecurityCallback:

## Public Member Functions
def | GetCipherType (document, sub_filter)
| A callback function used to get the cipher type for encryption algorithm. More...
def | GetFileID (document, sub_filter)
| A callback function used to get the file identity string. More...
def | GetInitialKey (document, sub_filter)
| A callback function used to get the initial key to decrypt the DRM protected document. More...
def | GetKeyLength (document, sub_filter)
| A callback function used to get the length of cipher key. More...
def | GetSecurityType ()
| Get the encryption type of security callback. More...
def | GetUserPermissions (document, sub_filter)
| A callback function used to get the current user permissions. More...
def | IsOwner (document, sub_filter)
| A callback function used to check if current user is the owner of the PDF document. More...
Public Member Functions inherited from FoxitPDFSDKPython2.SecurityCallback
def | Release ()
| A callback function used to release current callback object itself. More...

## Detailed Description

This class represents a callback object for Foxit DRM decryption. If user wants to use their own Foxit DRM security callback, user should inherit this callback class and implement the pure virtual functions (as callback functions), and then register their own Foxit DRM security callback object to Foxit PDF SDK by function FoxitPDFSDKPython2.Library.RegisterSecurityCallback with filter "FoxitDRM". Function FoxitPDFSDKPython2.Library.UnregisterSecurityCallback can be called to unregister the security callback object with the registered filter name.

## Member Function Documentation

## ◆ GetCipherType()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetCipherType | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to get the cipher type for encryption algorithm.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  The cipher type. Please refer to values starting from FoxitPDFSDKPython2.SecurityHandler.e_CipherNone and this should be one of these values.

## ◆ GetFileID()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetFileID | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to get the file identity string.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  The identity string, used to identify the file.

## ◆ GetInitialKey()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetInitialKey | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to get the initial key to decrypt the DRM protected document.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  The initial key.

## ◆ GetKeyLength()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetKeyLength | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to get the length of cipher key.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  The key length.
  For FoxitPDFSDKPython2.SecurityHandler.e_CipherRC4 cipher, this value should be between 5 and 16.
  For FoxitPDFSDKPython2.SecurityHandler.e_CipherAES cipher, this value should be 16 or 32.

## ◆ GetSecurityType()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetSecurityType | ( |  | ) |

Get the encryption type of security callback.

Note
  User should not override this function, otherwise there will be unexpected behavior.

Returns
  The encryption type. It would always be FoxitPDFSDKPython2.PDFDoc.e_EncryptFoxitDRM .

Reimplemented from FoxitPDFSDKPython2.SecurityCallback.

## ◆ GetUserPermissions()

def FoxitPDFSDKPython2.DRMSecurityCallback.GetUserPermissions | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to get the current user permissions.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  Current user permissions. Please refer to values starting from FoxitPDFSDKPython2.PDFDoc.e_PermPrint and this can be one or combination of these values.

## ◆ IsOwner()

def FoxitPDFSDKPython2.DRMSecurityCallback.IsOwner | ( |  | document,
|  |  | sub_filter
| ) |  |

A callback function used to check if current user is the owner of the PDF document.

Parameters

  [in] | document | A PDF document object.
  [in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents.

Note
  User should implement this callback function.

Returns
  true means current user is the owner of the PDF document, while false means not.