| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_LENGTH
The default length for the encryption key. |
| public static final String | DEFAULT_NAME
The default security handler. |
| public static final int | DEFAULT_VERSION
The default version, according to the PDF Reference. |
| private final COSDictionary | |
| private SecurityHandler | |
| public static final int | VERSION0_UNDOCUMENTED_UNSUPPORTED
See PDF Reference 1.4 Table 3.13. |
| public static final int | VERSION1_40_BIT_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
| public static final int | VERSION2_VARIABLE_LENGTH_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
| public static final int | VERSION3_UNPUBLISHED_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
| public static final int | VERSION4_SECURITY_HANDLER
See PDF Reference 1.4 Table 3.13. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PDEncryption(COSDictionary
a COS encryption dictionary dictionary)creates a new encryption dictionary from the low level dictionary provided. |
| Modifier and Type | Method and Description |
|---|---|
| public COSDictionary | Returns: The COS dictionary that this object wraps.Implements org. This will get the dictionary associated with this encryption dictionary. |
| public PDCryptFilterDictionary | Returns: the crypt filter with the given name if availablethe name of the crypt filter cryptFilterName)Returns the crypt filter with the given name. |
| public PDCryptFilterDictionary | Returns: the default crypt filter if available.Returns the default crypt filter (for public-key security handler). |
| public final String | Returns: The filter name contained in this encryption dictionary.Get the name of the filter. |
| public int | Returns: The length in bits for the encryption algorithmThis will return the Length entry of the encryption dictionary. |
| public byte[] | Returns: A 32 byte array or null if there is no owner encryption key.This will get the OE entry in the standard encryption dictionary. |
| public byte[] | Returns: A 32 byte array or null if there is no owner key.This will get the O entry in the standard encryption dictionary. |
| public int | |
| public byte[] | Returns: A 16 byte array or null if there is no Perms entry.Get the Perms entry in the encryption dictionary. |
| public int | Returns: the number of recipients contained in the Recipients field.Returns the number of recipients contained in the Recipients field of the dictionary. |
| public COSString | Returns: a COSString object containing information about the recipient number i.the position in the Recipients field array. i)returns the COSString contained in the Recipients field at position i. |
| public int | Returns: The encryption revision to use.This will return the R entry of the encryption dictionary. |
| public SecurityHandler | Returns: a security handler instanceReturns the security handler specified in the dictionary's Filter entry. |
| public PDCryptFilterDictionary | Returns: the standard crypt filter if available.Returns the standard crypt filter. |
| public COSName | Returns: the name of the filterReturns the name of the filter which is used for de/encrypting streams. |
| public COSName | Returns: the name of the filterReturns the name of the filter which is used for de/encrypting strings. |
| public String | Returns: The subfilter name contained in this encryption dictionary.Get the name of the subfilter. |
| public byte[] | Returns: A 32 byte array or null if there is no user encryption key.This will get the UE entry in the standard encryption dictionary. |
| public byte[] | Returns: A 32 byte array or null if there is no user key.This will get the U entry in the standard encryption dictionary. |
| public int | Returns: The encryption version to use.This will return the V entry of the encryption dictionary. |
| public boolean | Returns: true if the security handler is availableReturns true if the security handler specified in the dictionary's Filter is available. |
| public boolean | Returns: true if EncryptMetaData is explicitly set to false (the default is true)Will get the EncryptMetaData dictionary info. |
| public void | |
| public void | setCryptFilterDictionary(COSName
the name of the crypt filter cryptFilterName, PDCryptFilterDictionary the crypt filter to set cryptFilterDictionary)Sets the crypt filter with the given name. |
| public void | setDefaultCryptFilterDictionary(PDCryptFilterDictionary
the standard crypt filter to set defaultFilterDictionary)Sets the default crypt filter (for public-key security handler). |
| public void | |
| public void | setLength(int
The new key length. length)This will set the number of bits to use for the encryption algorithm. |
| public void | setOwnerEncryptionKey(byte[]
A 32 byte array or null if there is no owner encryption key. oe)This will set the OE entry in the standard encryption dictionary. |
| public void | setOwnerKey(byte[]
A 32 byte array or null if there is no owner key. o)This will set the O entry in the standard encryption dictionary. |
| public void | |
| public void | |
| public void | setRecipients(byte[][]
the array of bytes arrays to put in the Recipients field. recipients)This will set the Recipients field of the dictionary. |
| public void | setRevision(int
The new encryption version. revision)This will set the R entry of the encryption dictionary. |
| public void | setSecurityHandler(SecurityHandler<ProtectionPolicy>
new security handler securityHandler)Sets the security handler used in this encryption dictionary |
| public void | setStdCryptFilterDictionary(PDCryptFilterDictionary
the standard crypt filter to set cryptFilterDictionary)Sets the standard crypt filter. |
| public void | setStreamFilterName(COSName
the name of the filter streamFilterName)Sets the name of the filter which is used for de/encrypting streams. |
| public void | setStringFilterName(COSName
the name of the filter stringFilterName)Sets the name of the filter which is used for de/encrypting strings. |
| public void | setSubFilter(String
The value of the subfilter field. subfilter)Set the subfilter entry of the encryption dictionary. |
| public void | setUserEncryptionKey(byte[]
A 32 byte array or null if there is no user encryption key. ue)This will set the UE entry in the standard encryption dictionary. |
| public void | setUserKey(byte[]
A 32 byte array. u)This will set the U entry in the standard encryption dictionary. |
| public void | setVersion(int
The new encryption version. version)This will set the V entry of the encryption dictionary. |
| DEFAULT_LENGTH | back to summary |
|---|---|
| public static final int DEFAULT_LENGTH The default length for the encryption key. | |
| DEFAULT_NAME | back to summary |
|---|---|
| public static final String DEFAULT_NAME The default security handler. | |
| DEFAULT_VERSION | back to summary |
|---|---|
| public static final int DEFAULT_VERSION The default version, according to the PDF Reference. | |
| dictionary | back to summary |
|---|---|
| private final COSDictionary dictionary | |
| securityHandler | back to summary |
|---|---|
| private SecurityHandler<ProtectionPolicy> securityHandler | |
| VERSION0_UNDOCUMENTED_UNSUPPORTED | back to summary |
|---|---|
| public static final int VERSION0_UNDOCUMENTED_UNSUPPORTED See PDF Reference 1.4 Table 3.13. | |
| VERSION1_40_BIT_ALGORITHM | back to summary |
|---|---|
| public static final int VERSION1_40_BIT_ALGORITHM See PDF Reference 1.4 Table 3.13. | |
| VERSION2_VARIABLE_LENGTH_ALGORITHM | back to summary |
|---|---|
| public static final int VERSION2_VARIABLE_LENGTH_ALGORITHM See PDF Reference 1.4 Table 3.13. | |
| VERSION3_UNPUBLISHED_ALGORITHM | back to summary |
|---|---|
| public static final int VERSION3_UNPUBLISHED_ALGORITHM See PDF Reference 1.4 Table 3.13. | |
| VERSION4_SECURITY_HANDLER | back to summary |
|---|---|
| public static final int VERSION4_SECURITY_HANDLER See PDF Reference 1.4 Table 3.13. | |
| PDEncryption | back to summary |
|---|---|
| public PDEncryption() creates a new empty encryption dictionary. | |
| PDEncryption | back to summary |
|---|---|
| public PDEncryption(COSDictionary dictionary) creates a new encryption dictionary from the low level dictionary provided.
| |
| getCOSObject | back to summary |
|---|---|
| public COSDictionary getCOSObject() Implements org. This will get the dictionary associated with this encryption dictionary.
| |
| getCryptFilterDictionary | back to summary |
|---|---|
| public PDCryptFilterDictionary getCryptFilterDictionary(COSName cryptFilterName) Returns the crypt filter with the given name.
| |
| getDefaultCryptFilterDictionary | back to summary |
|---|---|
| public PDCryptFilterDictionary getDefaultCryptFilterDictionary() Returns the default crypt filter (for public-key security handler).
| |
| getFilter | back to summary |
|---|---|
| public final String getFilter() Get the name of the filter.
| |
| getLength | back to summary |
|---|---|
| public int getLength() This will return the Length entry of the encryption dictionary.
| |
| getOwnerEncryptionKey | back to summary |
|---|---|
| public byte[] getOwnerEncryptionKey() throws IOException This will get the OE entry in the standard encryption dictionary.
| |
| getOwnerKey | back to summary |
|---|---|
| public byte[] getOwnerKey() throws IOException This will get the O entry in the standard encryption dictionary.
| |
| getPermissions | back to summary |
|---|---|
| public int getPermissions() This will get the permissions bit mask.
| |
| getPerms | back to summary |
|---|---|
| public byte[] getPerms() throws IOException Get the Perms entry in the encryption dictionary.
| |
| getRecipientsLength | back to summary |
|---|---|
| public int getRecipientsLength() Returns the number of recipients contained in the Recipients field of the dictionary.
| |
| getRecipientStringAt | back to summary |
|---|---|
| public COSString getRecipientStringAt(int i) returns the COSString contained in the Recipients field at position i.
| |
| getRevision | back to summary |
|---|---|
| public int getRevision() This will return the R entry of the encryption dictionary.
| |
| getSecurityHandler | back to summary |
|---|---|
| public SecurityHandler Returns the security handler specified in the dictionary's Filter entry.
| |
| getStdCryptFilterDictionary | back to summary |
|---|---|
| public PDCryptFilterDictionary getStdCryptFilterDictionary() Returns the standard crypt filter.
| |
| getStreamFilterName | back to summary |
|---|---|
| public COSName getStreamFilterName() Returns the name of the filter which is used for de/encrypting streams. Default value is "Identity".
| |
| getStringFilterName | back to summary |
|---|---|
| public COSName getStringFilterName() Returns the name of the filter which is used for de/encrypting strings. Default value is "Identity".
| |
| getSubFilter | back to summary |
|---|---|
| public String getSubFilter() Get the name of the subfilter.
| |
| getUserEncryptionKey | back to summary |
|---|---|
| public byte[] getUserEncryptionKey() throws IOException This will get the UE entry in the standard encryption dictionary.
| |
| getUserKey | back to summary |
|---|---|
| public byte[] getUserKey() throws IOException This will get the U entry in the standard encryption dictionary.
| |
| getVersion | back to summary |
|---|---|
| public int getVersion() This will return the V entry of the encryption dictionary.
| |
| hasSecurityHandler | back to summary |
|---|---|
| public boolean hasSecurityHandler() Returns true if the security handler specified in the dictionary's Filter is available.
| |
| isEncryptMetaData | back to summary |
|---|---|
| public boolean isEncryptMetaData() Will get the EncryptMetaData dictionary info.
| |
| removeV45filters | back to summary |
|---|---|
| public void removeV45filters() remove CF, StmF, and StrF entries. This is to be called if V is not 4 or 5. | |
| setCryptFilterDictionary | back to summary |
|---|---|
| public void setCryptFilterDictionary(COSName cryptFilterName, PDCryptFilterDictionary cryptFilterDictionary) Sets the crypt filter with the given name.
| |
| setDefaultCryptFilterDictionary | back to summary |
|---|---|
| public void setDefaultCryptFilterDictionary(PDCryptFilterDictionary defaultFilterDictionary) Sets the default crypt filter (for public-key security handler).
| |
| setFilter | back to summary |
|---|---|
| public void setFilter(String filter) Sets the filter entry of the encryption dictionary.
| |
| setLength | back to summary |
|---|---|
| public void setLength(int length) This will set the number of bits to use for the encryption algorithm.
| |
| setOwnerEncryptionKey | back to summary |
|---|---|
| public void setOwnerEncryptionKey(byte[] oe) throws IOException This will set the OE entry in the standard encryption dictionary.
| |
| setOwnerKey | back to summary |
|---|---|
| public void setOwnerKey(byte[] o) throws IOException This will set the O entry in the standard encryption dictionary.
| |
| setPermissions | back to summary |
|---|---|
| public void setPermissions(int permissions) This will set the permissions bit mask.
| |
| setPerms | back to summary |
|---|---|
| public void setPerms(byte[] perms) throws IOException Set the Perms entry in the encryption dictionary.
| |
| setRecipients | back to summary |
|---|---|
| public void setRecipients(byte[][] recipients) throws IOException This will set the Recipients field of the dictionary. This field contains an array of string.
| |
| setRevision | back to summary |
|---|---|
| public void setRevision(int revision) This will set the R entry of the encryption dictionary. Note This value is used to decrypt the pdf document. If you change this when the document is encrypted then decryption will fail!.
| |
| setSecurityHandler | back to summary |
|---|---|
| public void setSecurityHandler(SecurityHandler<ProtectionPolicy> securityHandler) Sets the security handler used in this encryption dictionary
| |
| setStdCryptFilterDictionary | back to summary |
|---|---|
| public void setStdCryptFilterDictionary(PDCryptFilterDictionary cryptFilterDictionary) Sets the standard crypt filter.
| |
| setStreamFilterName | back to summary |
|---|---|
| public void setStreamFilterName(COSName streamFilterName) Sets the name of the filter which is used for de/encrypting streams.
| |
| setStringFilterName | back to summary |
|---|---|
| public void setStringFilterName(COSName stringFilterName) Sets the name of the filter which is used for de/encrypting strings.
| |
| setSubFilter | back to summary |
|---|---|
| public void setSubFilter(String subfilter) Set the subfilter entry of the encryption dictionary.
| |
| setUserEncryptionKey | back to summary |
|---|---|
| public void setUserEncryptionKey(byte[] ue) throws IOException This will set the UE entry in the standard encryption dictionary.
| |
| setUserKey | back to summary |
|---|---|
| public void setUserKey(byte[] u) throws IOException This will set the U entry in the standard encryption dictionary.
| |
| setVersion | back to summary |
|---|---|
| public void setVersion(int version) This will set the V entry of the encryption dictionary. Note This value is used to decrypt the pdf document. If you change this when the document is encrypted then decryption will fail!.
| |