Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdmodel.encryption » [javadoc | source]
org.apache.pdfbox.pdmodel.encryption
public class: PDEncryptionDictionary [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdmodel.encryption.PDEncryptionDictionary

Direct Known Subclasses:
    PDStandardEncryption

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
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. 
public static final  String DEFAULT_NAME    The default security handler. 
public static final  int DEFAULT_LENGTH    The default length for the encryption key. 
public static final  int DEFAULT_VERSION    The default version, according to the PDF Reference. 
protected  COSDictionary encryptionDictionary    COS encryption dictionary. 
Constructor:
 public PDEncryptionDictionary() 
 public PDEncryptionDictionary(COSDictionary d) 
    creates a new encryption dictionary from the low level dictionary provided.
    Parameters:
    d - the low level dictionary that will be managed by the newly created object
Method from org.apache.pdfbox.pdmodel.encryption.PDEncryptionDictionary Summary:
getCOSDictionary,   getFilter,   getLength,   getOwnerKey,   getPermissions,   getRecipientStringAt,   getRecipientsLength,   getRevision,   getUserKey,   getVersion,   setFilter,   setLength,   setOwnerKey,   setPermissions,   setRecipients,   setRevision,   setSubFilter,   setUserKey,   setVersion
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdmodel.encryption.PDEncryptionDictionary Detail:
 public COSDictionary getCOSDictionary() 
    This will get the dictionary associated with this encryption dictionary.
 public String getFilter() 
    Get the name of the filter.
 public int getLength() 
    This will return the Length entry of the encryption dictionary.

    The length in bits for the encryption algorithm. This will return a multiple of 8.
 public byte[] getOwnerKey() throws IOException 
    This will get the O entry in the standard encryption dictionary.
 public int getPermissions() 
    This will get the permissions bit mask.
 public COSString getRecipientStringAt(int i) 
    returns the COSString contained in the Recipients field at position i.
 public int getRecipientsLength() 
    Returns the number of recipients contained in the Recipients field of the dictionary.
 public int getRevision() 
    This will return the R entry of the encryption dictionary.

    See PDF Reference 1.4 Table 3.14.
 public byte[] getUserKey() throws IOException 
    This will get the U entry in the standard encryption dictionary.
 public int getVersion() 
    This will return the V entry of the encryption dictionary.

    See PDF Reference 1.4 Table 3.13.
 public  void setFilter(String filter) 
    Sets the filter entry of the encryption dictionary.
 public  void setLength(int length) 
    This will set the number of bits to use for the encryption algorithm.
 public  void setOwnerKey(byte[] o) throws IOException 
    This will set the O entry in the standard encryption dictionary.
 public  void setPermissions(int permissions) 
    This will set the permissions bit mask.
 public  void setRecipients(byte[][] recipients) throws IOException 
    This will set the Recipients field of the dictionary. This field contains an array of string.
 public  void setRevision(int revision) 
    This will set the R entry of the encryption dictionary.

    See PDF Reference 1.4 Table 3.14.

    Note: This value is used to decrypt the pdf document. If you change this when the document is encrypted then decryption will fail!.
 public  void setSubFilter(String subfilter) 
    Set the subfilter entry of the encryption dictionary.
 public  void setUserKey(byte[] u) throws IOException 
    This will set the U entry in the standard encryption dictionary.
 public  void setVersion(int version) 
    This will set the V entry of the encryption dictionary.

    See PDF Reference 1.4 Table 3.13.

    Note: This value is used to decrypt the pdf document. If you change this when the document is encrypted then decryption will fail!.