public class FoxitDRMEncryptionParams extends EncryptionParams
FoxitDRMEncryptionParams
is used for Foxit DRM encryption.
It inherits from class EncryptionParams
and also contains methods to access to parameters specified for Foxit DRM encryption.
A FoxitDRMEncryptionParams
object should be created and set,
if users want to use PDFDocument.startEncryption(EncryptionParams, com.foxit.gsdk.utils.FileHandler, int)
to do Foxit DRM encryption.CIPHER_AES, CIPHER_NONE, CIPHER_RC4
Constructor and Description |
---|
FoxitDRMEncryptionParams()
Default constructor of FoxitDRMEncryptionParams.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDRMParam(java.lang.String key)
Get string value of a key from encryption parameter used for Foxit DRM security.
|
void |
setCryptionParams(FoxitDRMHandler.CryptionParams params)
Set the encryption parameters.
|
void |
setDRMParam(java.lang.String key,
java.lang.String value)
Set string value of a key as encryption parameters for Foxit DRM encryption.
|
void |
setSubFilter(java.lang.String subFilter)
Set the subfilter of the custom security handler.
|
boolean |
verifyDRMParams()
Verify DRM encryption parameters in a PDF document.
|
getFilter, getParam, getSubFilter, getType, setEncryptMetadata
public FoxitDRMEncryptionParams()
public boolean verifyDRMParams() throws PDFException
This function is valid only when current FoxitDRMEncryptionParams
object is returned by PDFDocument.getEncryptionParams()
.
If current FoxitDRMEncryptionParams
object is newly created, this function will return false
.
Foxit DRM maintains a set of encryption keys for application purpose. Encryption keys are stored in PDF file and protected by verification algorithm. So application should call this function to do the verification. If the verification is failed, the document might be distorted.
Do not use this function for a non-Foxit DRM encrypted file.
Call function
to check if a PDF document is encrypted by Foxit DRM security.EncryptionParams.getType()
true
for success, or false
for failure.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getDRMParam(java.lang.String key) throws PDFException
This function is valid only when current FoxitDRMEncryptionParams
object is returned by PDFDocument.getEncryptionParams()
.
If current FoxitDRMEncryptionParams
object is newly created, this function will return null
.
key
- A String
object to the key string specified which is to get. Caller can define private key name.String
object that receives the string value.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setDRMParam(java.lang.String key, java.lang.String value) throws PDFException
This function is valid only when current FoxitDRMEncryptionParams
object is newly created.
And this function should be called to set value of Foxit DRM encryption parameters before doing Foxit DRM encryption
by calling PDFDocument.startEncryption(EncryptionParams, com.foxit.gsdk.utils.FileHandler, int)
.
key
- A String
object to the key string specified which is to set. Caller can define private key name.value
- A String
object which is the key string value.
If value
is null
, key
will be removed.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCryptionParams(FoxitDRMHandler.CryptionParams params) throws PDFException
FoxitDRMEncryptionParams
object is newly created.params
- A CryptionParams
object to specify encryption parameters. It should be valid.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
FoxitDRMHandler.CryptionParams
public void setSubFilter(java.lang.String subFilter) throws PDFException
FoxitDRMEncryptionParams
object is newly created.subFilter
- A String
object to specify the sub filter of the custom security handler.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException