|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.pdmodel.encryption.PDEncryptionDictionary
This class is a specialized view of the encryption dictionary of a PDF document. It contains a low level dictionary (COSDictionary) and provides the methods to manage its fields. The available fields are the ones who are involved by standard security handler and public key security handler.
Field Summary | |
static int |
DEFAULT_LENGTH
The default length for the encryption key. |
static String |
DEFAULT_NAME
The default security handler. |
static int |
DEFAULT_VERSION
The default version, according to the PDF Reference. |
protected COSDictionary |
encryptionDictionary
COS encryption dictionary. |
static int |
VERSION0_UNDOCUMENTED_UNSUPPORTED
See PDF Reference 1.4 Table 3.13. |
static int |
VERSION1_40_BIT_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
static int |
VERSION2_VARIABLE_LENGTH_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
static int |
VERSION3_UNPUBLISHED_ALGORITHM
See PDF Reference 1.4 Table 3.13. |
static int |
VERSION4_SECURITY_HANDLER
See PDF Reference 1.4 Table 3.13. |
Constructor Summary | |
PDEncryptionDictionary()
creates a new empty encryption dictionary. |
|
PDEncryptionDictionary(COSDictionary d)
creates a new encryption dictionary from the low level dictionary provided. |
Method Summary | |
COSDictionary |
getCOSDictionary()
This will get the dictionary associated with this encryption dictionary. |
String |
getFilter()
Get the name of the filter. |
int |
getLength()
This will return the Length entry of the encryption dictionary. |
byte[] |
getOwnerKey()
This will get the O entry in the standard encryption dictionary. |
int |
getPermissions()
This will get the permissions bit mask. |
int |
getRecipientsLength()
Returns the number of recipients contained in the Recipients field of the dictionary. |
COSString |
getRecipientStringAt(int i)
returns the COSString contained in the Recipients field at position i. |
int |
getRevision()
This will return the R entry of the encryption dictionary. |
byte[] |
getUserKey()
This will get the U entry in the standard encryption dictionary. |
int |
getVersion()
This will return the V entry of the encryption dictionary. |
void |
setFilter(String filter)
Sets the filter entry of the encryption dictionary. |
void |
setLength(int length)
This will set the number of bits to use for the encryption algorithm. |
void |
setOwnerKey(byte[] o)
This will set the O entry in the standard encryption dictionary. |
void |
setPermissions(int permissions)
This will set the permissions bit mask. |
void |
setRecipients(byte[][] recipients)
This will set the Recipients field of the dictionary. |
void |
setRevision(int revision)
This will set the R entry of the encryption dictionary. |
void |
setSubFilter(String subfilter)
Set the subfilter entry of the encryption dictionary. |
void |
setUserKey(byte[] u)
This will set the U entry in the standard encryption dictionary. |
void |
setVersion(int version)
This will set the V entry of the encryption dictionary. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int VERSION0_UNDOCUMENTED_UNSUPPORTED
public static final int VERSION1_40_BIT_ALGORITHM
public static final int VERSION2_VARIABLE_LENGTH_ALGORITHM
public static final int VERSION3_UNPUBLISHED_ALGORITHM
public static final int VERSION4_SECURITY_HANDLER
public static final String DEFAULT_NAME
public static final int DEFAULT_LENGTH
public static final int DEFAULT_VERSION
protected COSDictionary encryptionDictionary
Constructor Detail |
public PDEncryptionDictionary()
public PDEncryptionDictionary(COSDictionary d)
d
- the low level dictionary that will be managed by the newly created objectMethod Detail |
public COSDictionary getCOSDictionary()
public void setFilter(String filter)
filter
- The filter name.public String getFilter()
public void setSubFilter(String subfilter)
subfilter
- The value of the subfilter field.public void setVersion(int version)
version
- The new encryption version.public int getVersion()
public void setLength(int length)
length
- The new key length.public int getLength()
public void setRevision(int revision)
revision
- The new encryption version.public int getRevision()
public void setOwnerKey(byte[] o) throws IOException
o
- A 32 byte array or null if there is no owner key.
IOException
- If there is an error setting the data.public byte[] getOwnerKey() throws IOException
IOException
- If there is an error accessing the data.public void setUserKey(byte[] u) throws IOException
u
- A 32 byte array.
IOException
- If there is an error setting the data.public byte[] getUserKey() throws IOException
IOException
- If there is an error accessing the data.public void setPermissions(int permissions)
permissions
- The new permissions bit maskpublic int getPermissions()
public void setRecipients(byte[][] recipients) throws IOException
recipients
- the array of bytes arrays to put in the Recipients field.
IOException
- If there is an error setting the data.public int getRecipientsLength()
public COSString getRecipientStringAt(int i)
i
- the position in the Recipients field array.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |