java.lang.Object | |
↳ | com.pdftron.sdf.SecurityHandler |
Known Direct Subclasses |
Standard Security Handler is a built-in password-based security handler.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | e_AES | Use Crypt filters with 128-bit AES (Advanced Encryption Standard) algorithm. | |||||||||
int | e_AES_256 | Use Crypt filters with 256-bit AES (Advanced Encryption Standard) algorithm. | |||||||||
int | e_RC4_128 | 128-bit RC4 algorithm. | |||||||||
int | e_RC4_40 | The algorithm Constants to be used in encrypting and decrypting the document. | |||||||||
int | e_access_support | The Constant e_access_support. | |||||||||
int | e_assemble_doc | The Constant e_assemble_doc. | |||||||||
int | e_doc_modify | The Constant e_doc_modify. | |||||||||
int | e_doc_open | The Constant e_doc_open. | |||||||||
int | e_extract_content | The Constant e_extract_content. | |||||||||
int | e_fill_forms | The Constant e_fill_forms. | |||||||||
int | e_mod_annot | The Constant e_mod_annot. | |||||||||
int | e_owner | The Constant e_owner. | |||||||||
int | e_print | The Constant e_print. | |||||||||
int | e_print_high | The Constant e_print_high. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SecurityHandler(int crypt_type)
Create a Standard Security Handler.
| |||||||||||
SecurityHandler(int key_len, int enc_code)
Create a Standard Security Handler.
| |||||||||||
SecurityHandler()
Instantiates a new security handler.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static SecurityHandler | __Create(long impl, Object ref) | ||||||||||
long | __GetHandle() | ||||||||||
void | __SetRefHandle(Object ref) | ||||||||||
void |
changeMasterPassword(byte[] passwordBuffer)
Modify the master/owner password.
| ||||||||||
void |
changeMasterPassword(String password)
Modify the master password.
| ||||||||||
void |
changeRevisionNumber(int rev_num)
Change the revision number and the encryption algorithm of the
standard security handler.
| ||||||||||
void |
changeUserPassword(byte[] passwordBuffer)
Modify the user password.
| ||||||||||
void |
changeUserPassword(String password)
Modify the user password.
| ||||||||||
Object | clone() | ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
int |
getEncryptionAlgorithmID()
Get the encryption algorithm ID.
| ||||||||||
String |
getHandlerDocName()
Get the name of SecurityHandler.
| ||||||||||
int |
getKeyLength()
Get the encryption key length.
| ||||||||||
String |
getMasterPassword()
Get the master password.
| ||||||||||
boolean |
getPermission(int type)
Get the security permission.
| ||||||||||
int |
getRevisionNumber()
Get the revision number.
| ||||||||||
String |
getUserPassword()
Get the user password.
| ||||||||||
boolean |
isAES()
Checks if encryption is AES.
| ||||||||||
boolean |
isAES(Obj stream)
The following function can be used to verify whether a given stream is
encrypted using AES.
| ||||||||||
boolean |
isMasterPasswordRequired()
Checks if is master password required.
| ||||||||||
boolean |
isModified()
Checks if SecurityHandler is modified.
| ||||||||||
boolean |
isRC4()
Checks if encryption is RC4.
| ||||||||||
boolean |
isUserPasswordRequired()
Checks if is user password required.
| ||||||||||
void |
setEncryptMetadata(boolean encrypt_metadata)
Indicates whether the document-level metadata stream is to
be encrypted.
| ||||||||||
void |
setModified()
The method allows derived classes to set SecurityHandler is modified flag.
| ||||||||||
void |
setModified(boolean is_modified)
The method allows derived classes to set SecurityHandler is modified flag.
| ||||||||||
void |
setPermission(int perm, boolean value)
Set the permission setting of the StdSecurityHandler.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Use Crypt filters with 128-bit AES (Advanced Encryption Standard) algorithm.
Use Crypt filters with 256-bit AES (Advanced Encryption Standard) algorithm.
128-bit RC4 algorithm.
The algorithm Constants to be used in encrypting and decrypting the document. 40-bit RC4 algorithm.
The Constant e_access_support.
The Constant e_assemble_doc.
The Constant e_doc_modify.
The Constant e_doc_open.
The Constant e_extract_content.
The Constant e_fill_forms.
The Constant e_mod_annot.
The Constant e_owner.
The Constant e_print.
The Constant e_print_high.
Create a Standard Security Handler.
crypt_type | The encryption algorithm identifier. |
---|
Create a Standard Security Handler.
key_len | The bit length of the encryption key (40 or 128 bit). Default value is 128. |
---|---|
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):
|
Instantiates a new security handler.
Modify the master/owner password.
passwordBuffer | The new master/owner password represented in bytes. |
---|
Modify the master password.
password | the new master/owner password |
---|
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): - 2 : Encryption using 40-bit RC4 algorithm. - 3 : Encryption using 128-bit RC4 algorithm. Available in PDF 1.4 and above. - 4 : Encryption using Crypt filters and 128-bit AES (Advanced Encryption Standard) algorithm. Available in PDF 1.6 and above. |
---|
Modify the user password.
passwordBuffer | The new user password represented in bytes. |
---|
Modify the user password.
password | the new user password |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
Get the encryption algorithm ID.
Get the name of SecurityHandler.
Get the encryption key length.
Note: The returned key length is given in bytes.
Get the master password.
Get the security permission.
type | security permission types |
---|
Get the revision number.
Get the user password.
Checks if encryption is AES.
The following function can be used to verify whether a given stream is encrypted using AES.
stream | A pointer to an SDF::Stream object |
---|
Checks if is master password required.
Checks if SecurityHandler is modified.
Checks if encryption is RC4.
Checks if is user password required.
Indicates whether the document-level metadata stream is to be encrypted.
Note: EncryptMetadata flag affects only Crypt filters available in PDF 1.5 (Acrobat 6) and later. By default, metadata stream will be encrypted.
encrypt_metadata | true if metadata stream should be encrypted, false otherwise. |
---|
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
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
is_modified | boolean value of SecurityHandler modification state |
---|
Set the permission setting of the StdSecurityHandler.
perm | indicates a permission to set or clear. It can be any of the following values: e_print // print the document. e_doc_modify // edit the document more than adding or modifying text notes. e_extract_content // enable content extraction e_mod_annot // allow modifications to annotations e_fill_forms // allow changes to fill in forms e_access_support // content access for the visually impaired. e_assemble_doc // allow document assembly e_print_high // high resolution print. |
---|---|
value | true if the permission/s should be granted, false otherwise. |