|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.pdmodel.encryption.PDEncryptionDictionary
org.pdfbox.pdmodel.encryption.PDStandardEncryption
public class PDStandardEncryption
This class holds information that is related to the standard PDF encryption. See PDF Reference 1.4 section "3.5 Encryption"
Field Summary | |
---|---|
static int |
DEFAULT_PERMISSIONS
The default set of permissions which is to allow all. |
static int |
DEFAULT_REVISION
The default revision of one is not specified. |
static String |
FILTER_NAME
The 'Filter' name for this security handler. |
static int |
REVISION2
Encryption revision 2. |
static int |
REVISION3
Encryption revision 3. |
static int |
REVISION4
Encryption revision 4. |
Fields inherited from class org.pdfbox.pdmodel.encryption.PDEncryptionDictionary |
---|
DEFAULT_LENGTH, DEFAULT_NAME, DEFAULT_VERSION, encryptionDictionary, VERSION0_UNDOCUMENTED_UNSUPPORTED, VERSION1_40_BIT_ALGORITHM, VERSION2_VARIABLE_LENGTH_ALGORITHM, VERSION3_UNPUBLISHED_ALGORITHM, VERSION4_SECURITY_HANDLER |
Constructor Summary | |
---|---|
PDStandardEncryption()
Default constructor that uses Version 2, Revision 3, 40 bit encryption, all permissions allowed. |
|
PDStandardEncryption(COSDictionary dict)
Constructor from existing dictionary. |
Method Summary | |
---|---|
boolean |
canAssembleDocument()
This will tell if the user can insert/rotate/delete pages. |
boolean |
canExtractContent()
This will tell if the user can extract text and images from the PDF document. |
boolean |
canExtractForAccessibility()
This will tell if the user can extract text and images from the PDF document for accessibility purposes. |
boolean |
canFillInForm()
This will tell if the user can fill in interactive forms. |
boolean |
canModify()
This will tell if the user can modify contents of the document. |
boolean |
canModifyAnnotations()
This will tell if the user can add/modify text annotations, fill in interactive forms fields. |
boolean |
canPrint()
This will tell if the user can print. |
boolean |
canPrintDegraded()
This will tell if the user can print the document in a degraded format. |
byte[] |
getOwnerKey()
This will get the O entry in the standard encryption dictionary. |
int |
getPermissions()
This will get the permissions bit mask. |
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. |
void |
setCanAssembleDocument(boolean allowAssembly)
Set if the user can insert/rotate/delete pages. |
void |
setCanExtractContent(boolean allowExtraction)
Set if the user can extract content from the document. |
void |
setCanExtractForAccessibility(boolean allowExtraction)
Set if the user can extract content from the document for accessibility purposes. |
void |
setCanFillInForm(boolean allowFillingInForm)
Set if the user can fill in interactive forms. |
void |
setCanModify(boolean allowModifications)
Set if the user can modify the document. |
void |
setCanModifyAnnotations(boolean allowAnnotationModification)
Set if the user can modify annotations. |
void |
setCanPrint(boolean allowPrinting)
Set if the user can print. |
void |
setCanPrintDegraded(boolean allowAssembly)
Set if the user can print the document in a degraded format. |
void |
setOwnerKey(byte[] o)
This will set the O entry in the standard encryption dictionary. |
void |
setPermissions(int p)
This will set the permissions bit mask. |
void |
setRevision(int revision)
This will set the R entry of the encryption dictionary. |
void |
setUserKey(byte[] u)
This will set the U entry in the standard encryption dictionary. |
Methods inherited from class org.pdfbox.pdmodel.encryption.PDEncryptionDictionary |
---|
getCOSDictionary, getFilter, getLength, getVersion, setLength, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FILTER_NAME
public static final int DEFAULT_REVISION
public static final int REVISION2
public static final int REVISION3
public static final int REVISION4
public static final int DEFAULT_PERMISSIONS
Constructor Detail |
---|
public PDStandardEncryption()
public PDStandardEncryption(COSDictionary dict)
dict
- The existing encryption dictionary.Method Detail |
---|
public int getRevision()
public void setRevision(int revision)
revision
- The new encryption version.public byte[] getOwnerKey()
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[] getUserKey()
public void setUserKey(byte[] u) throws IOException
u
- A 32 byte array.
IOException
- If there is an error setting the data.public int getPermissions()
public void setPermissions(int p)
p
- The new permissions bit maskpublic boolean canPrint()
public void setCanPrint(boolean allowPrinting)
allowPrinting
- A boolean determining if the user can print.public boolean canModify()
public void setCanModify(boolean allowModifications)
allowModifications
- A boolean determining if the user can modify the document.public boolean canExtractContent()
public void setCanExtractContent(boolean allowExtraction)
allowExtraction
- A boolean determining if the user can extract content
from the document.public boolean canModifyAnnotations()
public void setCanModifyAnnotations(boolean allowAnnotationModification)
allowAnnotationModification
- A boolean determining if the user can modify annotations.public boolean canFillInForm()
public void setCanFillInForm(boolean allowFillingInForm)
allowFillingInForm
- A boolean determining if the user can fill in interactive forms.public boolean canExtractForAccessibility()
public void setCanExtractForAccessibility(boolean allowExtraction)
allowExtraction
- A boolean determining if the user can extract content
from the document.public boolean canAssembleDocument()
public void setCanAssembleDocument(boolean allowAssembly)
allowAssembly
- A boolean determining if the user can assemble the document.public boolean canPrintDegraded()
public void setCanPrintDegraded(boolean allowAssembly)
allowAssembly
- A boolean determining if the user can print the
document in a degraded format.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |