Foxit PDF SDK
foxit::pdf::DRMSecurityCallback Class Referenceabstract
Inheritance diagram for foxit::pdf::DRMSecurityCallback:
foxit::pdf::SecurityCallback

Public Member Functions

virtual SecurityHandler::CipherType GetCipherType (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to get the cipher type for encryption algorithm. More...
 
virtual String GetFileID (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to get the file identity string. More...
 
virtual String GetInitialKey (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to get the initial key to decrypt the DRM protected document. More...
 
virtual uint32 GetKeyLength (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to get the length of cipher key. More...
 
virtual PDFDoc::EncryptType GetSecurityType ()
 Get the encryption type of security callback. More...
 
virtual uint32 GetUserPermissions (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to get the current user permissions. More...
 
virtual bool IsOwner (const PDFDoc &document, const char *sub_filter)=0
 A callback function used to check if current user is the owner of the PDF document. More...
 
- Public Member Functions inherited from foxit::pdf::SecurityCallback
virtual void Release ()=0
 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 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()

virtual SecurityHandler::CipherType foxit::pdf::DRMSecurityCallback::GetCipherType ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

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

Parameters
[in]documentA PDF document object.
[in]sub_filterThe 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 SecurityHandler::e_CipherNone and this should be one of these values.

◆ GetFileID()

virtual String foxit::pdf::DRMSecurityCallback::GetFileID ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

A callback function used to get the file identity string.

Parameters
[in]documentA PDF document object.
[in]sub_filterThe 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()

virtual String foxit::pdf::DRMSecurityCallback::GetInitialKey ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

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

Parameters
[in]documentA PDF document object.
[in]sub_filterThe sub filter name that specifies the syntax of the encryption dictionary contents.
Note
User should implement this callback function.
Returns
The initial key.

◆ GetKeyLength()

virtual uint32 foxit::pdf::DRMSecurityCallback::GetKeyLength ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

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

Parameters
[in]documentA PDF document object.
[in]sub_filterThe sub filter name that specifies the syntax of the encryption dictionary contents.
Note
User should implement this callback function.
Returns
The key length.
For SecurityHandler::e_CipherRC4 cipher, this value should be between 5 and 16.
For SecurityHandler::e_CipherAES cipher, this value should be 16 or 32.

◆ GetSecurityType()

virtual PDFDoc::EncryptType foxit::pdf::DRMSecurityCallback::GetSecurityType ( )
inlinevirtual

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 PDFDoc::e_EncryptFoxitDRM.

Reimplemented from foxit::pdf::SecurityCallback.

◆ GetUserPermissions()

virtual uint32 foxit::pdf::DRMSecurityCallback::GetUserPermissions ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

A callback function used to get the current user permissions.

Parameters
[in]documentA PDF document object.
[in]sub_filterThe 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 PDFDoc::e_PermPrint and this can be one or combination of these values.

◆ IsOwner()

virtual bool foxit::pdf::DRMSecurityCallback::IsOwner ( const PDFDoc document,
const char *  sub_filter 
)
pure virtual

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

Parameters
[in]documentA PDF document object.
[in]sub_filterThe 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.