public class EncryptionParams
extends java.lang.Object
EncryptionParams
is the base class for encryption parameters.
It contains methods to access to common parameters to all types of encryption. PasswordEncryptionParams
for standard password encryption. CustomEncryptionParams
for customized encryptionCertificateEncryptionParams
for certificate encryptionFoxitDRMEncryptionParams
for Foxit DRM encryptionModifier and Type | Field and Description |
---|---|
static int |
CIPHER_AES
Use AES encryption algorithm, with the key length be 16-bytes or 32-bytes.
|
static int |
CIPHER_NONE
Not use encryption algorithm.
|
static int |
CIPHER_RC4
Use RC4 encryption algorithm, with the key length between 5-bytes and 16-bytes.
|
Constructor and Description |
---|
EncryptionParams() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilter()
Get encryption filter value.
|
java.lang.String |
getParam(java.lang.String key)
Get encryption parameter value.
|
java.lang.String |
getSubFilter()
Get encryption sub-filter value.
|
int |
getType()
Get the encryption type of current encryption parameters object.
|
void |
setEncryptMetadata(boolean isEncrypt)
Set a boolean value which indicates whether to encrypt the metadata or not.
|
public static final int CIPHER_NONE
public static final int CIPHER_RC4
public static final int CIPHER_AES
public int getType()
public java.lang.String getFilter() throws PDFException
This function is valid only when current EncryptionParams
object is returned by PDFDocument.getEncryptionParams()
.
If current EncryptionParams
object is newly created, this function will return null
.
String
object indicates encryption filter. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getSubFilter() throws PDFException
This function is valid only when current EncryptionParams
object is returned by PDFDocument.getEncryptionParams()
.
If current EncryptionParams
object is newly created, this function will return null
.
String
object indicates encryption sub-filter. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getParam(java.lang.String key) throws PDFException
This function is valid only when current EncryptionParams
object is returned by PDFDocument.getEncryptionParams()
.
If current EncryptionParams
object is newly created, this function will return null
.
key
- A String
object indicates a key to the encrypted data.String
object indicates encryption key value. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setEncryptMetadata(boolean isEncrypt)
EncryptionParams
object is newly created.isEncrypt
- A boolean value which indicates whether to encrypt the metadata or not:
true
means to encrypt metadata.false