Foxit PDF SDK
|
Public Member Functions | |
java.lang.Object | createContext (String filter, String sub_filter, String encrypt_info) |
A callback function used to create context for encryption and decryption. More... | |
byte[] | decryptData (java.lang.Object decryptor, byte[] encrypted_data) |
A callback function used to decrypt the encrypted data. More... | |
boolean | encryptData (java.lang.Object context, int obj_num, int gen_num, byte[] src_data, byte[] out_dst_buffer) |
A callback function used to get encrypted data. More... | |
byte[] | finishDecryptor (java.lang.Object decryptor) |
A callback function used to finish the decryption. More... | |
int | getCipher (java.lang.Object context) |
A callback function used to get the cipher type. More... | |
int | getDecryptedSize (java.lang.Object context, int src_data_size) |
A callback function used to get the estimated decrypted data size. More... | |
int | getEncryptedSize (java.lang.Object context, int obj_num, int gen_num, byte[] src_data) |
A callback function used to get the estimated encrypted size. More... | |
byte[] | getEncryptKey (java.lang.Object context) |
A callback function used to get the encryption key. More... | |
int | getSecurityType () |
Get the encryption type of security callback. More... | |
int | getUserPermissions (java.lang.Object context, int user_permission) |
A callback function used to get the user permissions. More... | |
boolean | isOwner (java.lang.Object context) |
A callback function used to check if current user is the owner of the PDF document. More... | |
boolean | releaseContext (java.lang.Object context) |
A callback function used to release the context for encryption and decryption. More... | |
java.lang.Object | startDecryptor (java.lang.Object context, int obj_num, int gen_num) |
A callback function used to start a decryption. More... | |
boolean | useStandardCryptoMethod (java.lang.Object context) |
A callback function to check if to use standard crypto method or custom crypto method. More... | |
![]() | |
void | release () |
A callback function used to release current callback object itself. More... | |
This class represents a callback object for custom decryption and encryption. If user wants to use custom security callback, user should inherit this callback class and implement the pure virtual functions (as callback functions), and then register the custom security callback object to Foxit PDF SDK by function common.Library.registerSecurityCallback with with any custom filter name (following the PDF name conventions). Function common.Library.unregisterSecurityCallback can be called to unregister the security callback object with the registered filter name.
java.lang.Object com.foxit.sdk.pdf.CustomSecurityCallback.createContext | ( | String | filter, |
String | sub_filter, | ||
String | encrypt_info | ||
) |
A callback function used to create context for encryption and decryption.
[in] | filter | The filter name of the custom security callback object. |
[in] | sub_filter | The sub filter name that specifies the syntax of the encryption dictionary contents. |
[in] | encrypt_info | The encryption information of the PDF document. |
byte[] com.foxit.sdk.pdf.CustomSecurityCallback.decryptData | ( | java.lang.Object | decryptor, |
byte[] | encrypted_data | ||
) |
A callback function used to decrypt the encrypted data.
[in] | decryptor | The decryptor implemented and created by user, returned by callback function CustomSecurityCallback.startDecryptor . |
[in] | encrypted_data | The buffer which stores the encrypted data. |
boolean com.foxit.sdk.pdf.CustomSecurityCallback.encryptData | ( | java.lang.Object | context, |
int | obj_num, | ||
int | gen_num, | ||
byte[] | src_data, | ||
byte[] | out_dst_buffer | ||
) |
A callback function used to get encrypted data.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
[in] | obj_num | The object number for a PDF object. |
[in] | gen_num | The generation number for a PDF object. |
[in] | src_data | The buffer which stores the plain text to be encrypted. |
[out] | out_dst_buffer | Output parameter that receives the encrypted content. |
byte[] com.foxit.sdk.pdf.CustomSecurityCallback.finishDecryptor | ( | java.lang.Object | decryptor | ) |
A callback function used to finish the decryption.
[in] | decryptor | The decryptor implemented and created by user, returned by callback function CustomSecurityCallback.startDecryptor . |
int com.foxit.sdk.pdf.CustomSecurityCallback.getCipher | ( | java.lang.Object | context | ) |
A callback function used to get the cipher type.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
int com.foxit.sdk.pdf.CustomSecurityCallback.getDecryptedSize | ( | java.lang.Object | context, |
int | src_data_size | ||
) |
A callback function used to get the estimated decrypted data size.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
[in] | src_data_size | Size of source data which is to be decrypted. |
int com.foxit.sdk.pdf.CustomSecurityCallback.getEncryptedSize | ( | java.lang.Object | context, |
int | obj_num, | ||
int | gen_num, | ||
byte[] | src_data | ||
) |
A callback function used to get the estimated encrypted size.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
[in] | obj_num | The object number for a PDF object. |
[in] | gen_num | The generation number for a PDF object. |
[in] | src_data | The buffer which stores the plain text to be encrypted. |
byte[] com.foxit.sdk.pdf.CustomSecurityCallback.getEncryptKey | ( | java.lang.Object | context | ) |
A callback function used to get the encryption key.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
int com.foxit.sdk.pdf.CustomSecurityCallback.getSecurityType | ( | ) |
Get the encryption type of security callback.
Reimplemented from com.foxit.sdk.pdf.SecurityCallback.
Reimplemented in com.foxit.sdk.pdf.RMSSecurityCallback.
int com.foxit.sdk.pdf.CustomSecurityCallback.getUserPermissions | ( | java.lang.Object | context, |
int | user_permission | ||
) |
A callback function used to get the user permissions.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
[in] | user_permission | Original permission settings of the document. Please refer to values starting from com.foxit.sdk.pdf.PDFDoc.e_PermPrint and this would be one or combination of these values. |
boolean com.foxit.sdk.pdf.CustomSecurityCallback.isOwner | ( | java.lang.Object | context | ) |
A callback function used to check if current user is the owner of the PDF document.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
boolean com.foxit.sdk.pdf.CustomSecurityCallback.releaseContext | ( | java.lang.Object | context | ) |
A callback function used to release the context for encryption and decryption.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
java.lang.Object com.foxit.sdk.pdf.CustomSecurityCallback.startDecryptor | ( | java.lang.Object | context, |
int | obj_num, | ||
int | gen_num | ||
) |
A callback function used to start a decryption.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
[in] | obj_num | The object number for a PDF object. |
[in] | gen_num | The generation number for a PDF object. |
boolean com.foxit.sdk.pdf.CustomSecurityCallback.useStandardCryptoMethod | ( | java.lang.Object | context | ) |
A callback function to check if to use standard crypto method or custom crypto method.
[in] | context | The context for encryption and decryption, returned by callback function CustomSecurityCallback.createContext . |
<ul> <li> <b>true</b> means to use standard crypto method. In this case, callback functions @link CustomSecurityCallback::getDecryptedSize CustomSecurityCallback.getDecryptedSize @endlink, @link CustomSecurityCallback::startDecryptor CustomSecurityCallback.startDecryptor @endlink, @link CustomSecurityCallback::decryptData CustomSecurityCallback.decryptData @endlink, @link CustomSecurityCallback::finishDecryptor CustomSecurityCallback.finishDecryptor @endlink, @link CustomSecurityCallback::getEncryptedSize CustomSecurityCallback.getEncryptedSize @endlink, and @link CustomSecurityCallback::encryptData CustomSecurityCallback.encryptData @endlink will be uselss and user can just use empty implementation for them. </li> <li> <b>false</b> means use custom crypto method. In this case, please ensure callback functions mentioned above have all been implemented. </li> </ul>