java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.encryption.PDCryptFilterDictionary
- All Implemented Interfaces:
COSObjectable
This class is a specialized view of the crypt filter dictionary of a PDF document. It contains a
low level dictionary (COSDictionary) and provides the methods to manage its fields.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis will return the crypt filter method.intThis will return the Length entry of the crypt filter dictionary.
The length in bits for the crypt filter algorithm.booleanWill get the EncryptMetaData dictionary info.voidThis will set the crypt filter method.voidsetEncryptMetaData(boolean encryptMetaData) Set the EncryptMetaData dictionary info.voidsetLength(int length) This will set the number of bits to use for the crypt filter algorithm.Methods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Constructor Details
-
PDCryptFilterDictionary
public PDCryptFilterDictionary() -
PDCryptFilterDictionary
-
-
Method Details
-
setLength
public void setLength(int length) This will set the number of bits to use for the crypt filter algorithm.- Parameters:
length- The new key length.
-
getLength
public int getLength()This will return the Length entry of the crypt filter dictionary.
The length in bits for the crypt filter algorithm. This will return a multiple of 8.- Returns:
- The length in bits for the encryption algorithm
-
setCryptFilterMethod
This will set the crypt filter method. Allowed values are: NONE, V2, AESV2, AESV3- Parameters:
cfm- name of the crypt filter method.- Throws:
IOException- If there is an error setting the data.
-
getCryptFilterMethod
This will return the crypt filter method. Allowed values are: NONE, V2, AESV2, AESV3- Returns:
- the name of the crypt filter method.
- Throws:
IOException- If there is an error accessing the data.
-
isEncryptMetaData
public boolean isEncryptMetaData()Will get the EncryptMetaData dictionary info.- Returns:
- true if EncryptMetaData is explicitly set (the default is true)
-
setEncryptMetaData
public void setEncryptMetaData(boolean encryptMetaData) Set the EncryptMetaData dictionary info.- Parameters:
encryptMetaData- true if EncryptMetaData shall be set.
-