com.foxit.sdk.pdf.DRMSecurityCallback Class Reference
Inheritance diagram for com.foxit.sdk.pdf.DRMSecurityCallback:
com.foxit.sdk.pdf.SecurityCallback

Public Member Functions

int getCipherType (PDFDoc document, String sub_filter)
 A callback function used to get the cipher type for encryption algorithm. More...
 
String getFileID (PDFDoc document, String sub_filter)
 A callback function used to get the file identity string. More...
 
byte [] getInitialKey (PDFDoc document, String sub_filter)
 A callback function used to get the initial key to decrypt the DRM protected document. More...
 
int getKeyLength (PDFDoc document, String sub_filter)
 A callback function used to get the length of cipher key. More...
 
int getSecurityType ()
 Get the encryption type of security callback. More...
 
int getUserPermissions (PDFDoc document, String sub_filter)
 A callback function used to get the current user permissions. More...
 
boolean isOwner (PDFDoc document, String sub_filter)
 A callback function used to check if current user is the owner of the PDF document. More...
 
- Public Member Functions inherited from com.foxit.sdk.pdf.SecurityCallback
int getSecurityType ()
 Get the encryption type of security callback. More...
 
void release ()
 A callback function used to release current security 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 common::Library::registerSecurityCallback with filter "FoxitDRM". Function common::Library::unregisterSecurityCallback can be called to unregister the security callback object with the registered filter name.

Member Function Documentation

◆ getCipherType()

int com.foxit.sdk.pdf.DRMSecurityCallback.getCipherType ( PDFDoc  document,
String  sub_filter 
)

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

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
The cipher type. Please refer to values starting from e_CipherNone and this should be one of these values.

◆ getFileID()

String com.foxit.sdk.pdf.DRMSecurityCallback.getFileID ( PDFDoc  document,
String  sub_filter 
)

A callback function used to get the file identity string.

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
The identity string, used to identify the file.

◆ getInitialKey()

byte[] com.foxit.sdk.pdf.DRMSecurityCallback.getInitialKey ( PDFDoc  document,
String  sub_filter 
)

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

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
The initial key.

◆ getKeyLength()

int com.foxit.sdk.pdf.DRMSecurityCallback.getKeyLength ( PDFDoc  document,
String  sub_filter 
)

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

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
The key length.
For e_CipherRC4 cipher, this value should be between 5 and 16.
For e_CipherAES cipher, this value should be 16 or 32.

◆ getSecurityType()

int com.foxit.sdk.pdf.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 e_EncryptFoxitDRM.

◆ getUserPermissions()

int com.foxit.sdk.pdf.DRMSecurityCallback.getUserPermissions ( PDFDoc  document,
String  sub_filter 
)

A callback function used to get the current user permissions.

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
Current user permissions. Please refer to values starting from e_PermPrint and this can be one or combination of these values.

◆ isOwner()

boolean com.foxit.sdk.pdf.DRMSecurityCallback.isOwner ( PDFDoc  document,
String  sub_filter 
)

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

Parameters
documentA PDF document object.
sub_filterThe sub filter of the PDF document.
Note
User should implement this callback function.
Returns
true means current user is the owner of the PDF document, while false means not.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.