|
#include <SecurityHandler.h>
Public Types | |
| enum | Permission { e_all = 1, e_doc_open, e_doc_secure, e_doc_modify, e_print, e_print_high, e_extract_content, e_mod_annot, e_fill_forms, e_access_support, e_assemble_doc } |
| enum | AlgorithmType { e_RC4_40 = 1, e_RC4_128, e_AES } |
| The algorithm to be used in encrypting and decrypting the document. More... | |
Public Member Functions | |
| SecurityHandler (TRN_SecurityHandler impl, bool owner) | |
| bool | GetPermission (Permission p) |
| |
| SecurityHandler | Clone () |
| |
| int | GetKeyLength () const |
| |
| int | GetEncryptionAlgorithmID () const |
| |
| const char * | GetHandlerDocName () const |
| |
| bool | IsModified () const |
| |
| void | SetModified (bool is_modified=true) |
| The method allows derived classes to set SecurityHandler is modified flag. | |
| SecurityHandler (AlgorithmType crypt_type) | |
| Create a Standard Security Handler. | |
| SecurityHandler (int key_len, int enc_code) | |
| Create a Standard Security Handler. | |
| SecurityHandler () | |
| SecurityHandler (const SecurityHandler &s) | |
| ~SecurityHandler () | |
| void | ChangeUserPassword (const char *password) |
| Modify the user password. | |
| const char * | GetUserPassword () |
| |
| void | ChangeMasterPassword (const char *password) |
| Modify the master password. | |
| const char * | GetMasterPassword () |
| |
| void | SetPermission (Permission perm, bool value) |
| Set the permission setting of the StdSecurityHandler. | |
| void | ChangeRevisionNumber (int rev_num) |
| Change the revision number and the encryption algorithm of the standard security handler. | |
| void | SetEncryptMetadata (bool encrypt_metadata) |
| Indicates whether the document-level metadata stream is to be encrypted. | |
| int | GetRevisionNumber () |
| |
| bool | IsUserPasswordRequired () |
| |
| bool | IsMasterPasswordRequired () |
| |
| bool | IsAES () const |
| |
| bool | IsAES (Obj stream) const |
| The following function can be used to verify whether a given stream is encrypted using AES. | |
| bool | IsRC4 () const |
| |
| operator bool () | |
| |
| pdftron::SDF::SecurityHandler::SecurityHandler | ( | TRN_SecurityHandler | impl, | |
| bool | owner | |||
| ) |
| pdftron::SDF::SecurityHandler::SecurityHandler | ( | AlgorithmType | crypt_type | ) |
Create a Standard Security Handler.
| crypt_type | The encryption algorithm identifier. |
| pdftron::SDF::SecurityHandler::SecurityHandler | ( | int | key_len, | |
| int | enc_code | |||
| ) |
Create a Standard Security Handler.
| key_len | The bit length of the encryption key (40 or 128 bit). | |
| enc_code | The encryption algorithm identifier. The number corresponds to the V entry in encryption dictionary. Currently allowed values are (see Table 3.18 in PDF Reference Manual v1.6 for more details):
|
| pdftron::SDF::SecurityHandler::SecurityHandler | ( | ) |
| pdftron::SDF::SecurityHandler::SecurityHandler | ( | const SecurityHandler & | s | ) |
| pdftron::SDF::SecurityHandler::~SecurityHandler | ( | ) |
| bool pdftron::SDF::SecurityHandler::GetPermission | ( | Permission | p | ) |
| p | A Permission to be granted. |
| SecurityHandler pdftron::SDF::SecurityHandler::Clone | ( | ) |
| int pdftron::SDF::SecurityHandler::GetKeyLength | ( | ) | const |
| int pdftron::SDF::SecurityHandler::GetEncryptionAlgorithmID | ( | ) | const |
A code specifying the algorithm to be used in encrypting and decrypting the document. Returned number corresponds to V entry in encryption dictionary. Currently allowed values are from 0-4. See PDF Reference Manual for more details.
| const char* pdftron::SDF::SecurityHandler::GetHandlerDocName | ( | ) | const |
| bool pdftron::SDF::SecurityHandler::IsModified | ( | ) | const |
If the user changes SecurityHandler's settings (e.g. by changing a password), IsModified() should return true.
| void pdftron::SDF::SecurityHandler::SetModified | ( | bool | is_modified = true |
) |
The method allows derived classes to set SecurityHandler is modified flag.
This method should be called whenever there are changes (e.g. a password change) to the SecurityHandler
| void pdftron::SDF::SecurityHandler::ChangeUserPassword | ( | const char * | password | ) |
Modify the user password.
| password | the new user password |
| const char* pdftron::SDF::SecurityHandler::GetUserPassword | ( | ) |
| void pdftron::SDF::SecurityHandler::ChangeMasterPassword | ( | const char * | password | ) |
Modify the master password.
| password | the new master/owner password |
| const char* pdftron::SDF::SecurityHandler::GetMasterPassword | ( | ) |
| void pdftron::SDF::SecurityHandler::SetPermission | ( | Permission | perm, | |
| bool | value | |||
| ) |
Set the permission setting of the StdSecurityHandler.
| perm | indicates a permission to set or clear. It can be any of the following values: |
| value | true if the permission/s should be granted, false otherwise. |
| void pdftron::SDF::SecurityHandler::ChangeRevisionNumber | ( | int | rev_num | ) |
Change the revision number and the encryption algorithm of the standard security handler.
| rev_num | the new revision number of the standard security algorithm. Currently allowed values for the revision number are (see Table 3.18 in PDF Reference Manual v1.6 for more details): |
| void pdftron::SDF::SecurityHandler::SetEncryptMetadata | ( | bool | encrypt_metadata | ) |
Indicates whether the document-level metadata stream is to be encrypted.
| encrypt_metadata | true if metadata stream should be encrypted, false otherwise. |
| int pdftron::SDF::SecurityHandler::GetRevisionNumber | ( | ) |
| bool pdftron::SDF::SecurityHandler::IsUserPasswordRequired | ( | ) |
| bool pdftron::SDF::SecurityHandler::IsMasterPasswordRequired | ( | ) |
| bool pdftron::SDF::SecurityHandler::IsAES | ( | ) | const |
| bool pdftron::SDF::SecurityHandler::IsAES | ( | Obj | stream | ) | const |
The following function can be used to verify whether a given stream is encrypted using AES.
| stream | A pointer to an SDF::Stream object |
| bool pdftron::SDF::SecurityHandler::IsRC4 | ( | ) | const |
| pdftron::SDF::SecurityHandler::operator bool | ( | ) | [inline] |