Foxit PDF SDK
<FSDRMSecurityCallback> Protocol Reference
Inheritance diagram for <FSDRMSecurityCallback>:
<FSSecurityCallback>

Instance Methods

(FSSecurityHandlerCipherType- getCipherType:sub_filter:
 A callback function used to get the cipher type for encryption algorithm. More...
 
(NSString *) - getFileID:sub_filter:
 A callback function used to get the file identity string. More...
 
(NSData *) - getInitialKey:sub_filter:
 A callback function used to get the initial key to decrypt the DRM protected document. More...
 
(int) - getKeyLength:sub_filter:
 A callback function used to get the length of cipher key. More...
 
(unsigned int) - getUserPermissions:sub_filter:
 A callback function used to get the current user permissions. More...
 
(BOOL) - isOwner:sub_filter:
 A callback function used to check if current user is the owner of the PDF document. More...
 
- Instance Methods inherited from <FSSecurityCallback>
(FSPDFDocEncryptType- GetSecurityType
 Get the encryption type of security callback. 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 FSLibrary::registerSecurityCallback:callback: with filter "FoxitDRM". Function FSLibrary::unregisterSecurityCallback: can be called to unregister the security callback object with the registered filter name.

Method Documentation

◆ getCipherType:sub_filter:()

- (FSSecurityHandlerCipherType) getCipherType: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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 FSSecurityHandlerCipherNone and this should be one of these values.

◆ getFileID:sub_filter:()

- (NSString*) getFileID: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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:sub_filter:()

- (NSData*) getInitialKey: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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:sub_filter:()

- (int) getKeyLength: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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 FSSecurityHandlerCipherRC4 cipher, this value should be between 5 and 16.
For FSSecurityHandlerCipherAES cipher, this value should be 16 or 32.

◆ getUserPermissions:sub_filter:()

- (unsigned int) getUserPermissions: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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 FSPDFDocPermPrint and this can be one or combination of these values.

◆ isOwner:sub_filter:()

- (BOOL) isOwner: (FSPDFDoc *)  document
sub_filter: (NSString *)  sub_filter 
required

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
YES means current user is the owner of the PDF document, while NO means not.