public class RMSEncryptionParams extends EncryptionParams
RMSEncryptionParams
is used for Microsoft RMS encryption.
It inherits from class EncryptionParams
and also contains methods to access to parameters specified for Microsoft RMS encryption.
A RMSEncryptionParams
object should be created and set,
if users want to use PDFDocument.startEncryption(EncryptionParams, com.foxit.gsdk.utils.FileHandler, int)
to do Microsoft RMS encryption.CIPHER_AES, CIPHER_NONE, CIPHER_RC4
Constructor and Description |
---|
RMSEncryptionParams()
Default constructor of RMSEncryptionParams.
|
Modifier and Type | Method and Description |
---|---|
void |
setIrmVersion(int irmVersion)
Set Microsoft IRM version.
|
void |
setPublishLicense(java.lang.String publishLicense)
Set publishing license.
|
void |
setServerEulList(java.lang.String[] serverEulList)
Set a string array that represents Server ID and Server EUL.
|
getFilter, getParam, getSubFilter, getType, setEncryptMetadata
public RMSEncryptionParams()
public void setPublishLicense(java.lang.String publishLicense) throws PDFException
The publishing license is from Microsoft IRM services or a comparable IRM service.
The original data of publishing license should be compressed by Flate compression algorithm at first,
and then encoded by Base-64 Encryption algorithm.
For Flate compression algorithm, JDK offers relative classes, such as java.util.zip.Deflater (and java.util.zip.Inflater for decompression).
For Base-64 Encryption algorithm, Foxit PDF SDK offeres function Base64.encode(byte[])
, along with Base64.decode(byte[])
used for decoding.
User can also choose to use the method offered by JDK or android SDK.
This function is valid only when current RMSEncryptionParams
object is newly created.
publishLicense
- A String
object that specifies Encoded Publishing License issued from server to the Content publisher.
It should be valid and not be empty.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setServerEulList(java.lang.String[] serverEulList) throws PDFException
This string array can be empty for no use.
When this array is valid, 2 strings in this array are in a pair, and each pair represents content of a dictionary object which is encoded Server EUL.
For each pair, the first string is ServerID, and the second one is ServerEUL.
The original data of Server ID and Server EUL should be compressed by Flate compression algorithm at first,
and then encoded by Base-64 Encryption algorithm.
For Flate compression algorithm, JDK offers relative classes, such as java.util.zip.Deflater (and java.util.zip.Inflater for decompression).
For Base-64 Encryption algorithm, Foxit PDF SDK offeres function Base64.encode(byte[])
, along with Base64.decode(byte[])
used for decoding.
User can also choose to use the method offered by JDK.
This function is valid only when current RMSEncryptionParams
object is newly created.
serverEulList
- A string array that specifies the Server ID and Server EUL. null
or empty.
But if it's valid, the length of the array should be multiply of 2.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setIrmVersion(int irmVersion)
This function is valid only when current RMSEncryptionParams
object is newly created.
irmVersion
- The value of Microsoft IRM version. Default: 1.
If the value is less than default value, the default value will be used.