Class PDStandardEncryption
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.encryption.PDEncryptionDictionary
-
- org.apache.pdfbox.pdmodel.encryption.PDStandardEncryption
-
public class PDStandardEncryption extends PDEncryptionDictionary
Deprecated.Made deprecated by the new security layer of PDFBox. Use SecurityHandlers instead.This class holds information that is related to the standard PDF encryption. See PDF Reference 1.4 section "3.5 Encryption"- Version:
- $Revision: 1.7 $
- Author:
- Ben Litchfield
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PERMISSIONSDeprecated.The default set of permissions which is to allow all.static intDEFAULT_REVISIONDeprecated.The default revision of one is not specified.static java.lang.StringFILTER_NAMEDeprecated.The 'Filter' name for this security handler.static intREVISION2Deprecated.Encryption revision 2.static intREVISION3Deprecated.Encryption revision 3.static intREVISION4Deprecated.Encryption revision 4.-
Fields inherited from class org.apache.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
Constructors Constructor Description PDStandardEncryption()Deprecated.Default constructor that uses Version 2, Revision 3, 40 bit encryption, all permissions allowed.PDStandardEncryption(COSDictionary dict)Deprecated.Constructor from existing dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanAssembleDocument()Deprecated.This will tell if the user can insert/rotate/delete pages.booleancanExtractContent()Deprecated.This will tell if the user can extract text and images from the PDF document.booleancanExtractForAccessibility()Deprecated.This will tell if the user can extract text and images from the PDF document for accessibility purposes.booleancanFillInForm()Deprecated.This will tell if the user can fill in interactive forms.booleancanModify()Deprecated.This will tell if the user can modify contents of the document.booleancanModifyAnnotations()Deprecated.This will tell if the user can add/modify text annotations, fill in interactive forms fields.booleancanPrint()Deprecated.This will tell if the user can print.booleancanPrintDegraded()Deprecated.This will tell if the user can print the document in a degraded format.byte[]getOwnerKey()Deprecated.This will get the O entry in the standard encryption dictionary.intgetPermissions()Deprecated.This will get the permissions bit mask.intgetRevision()Deprecated.This will return the R entry of the encryption dictionary.
See PDF Reference 1.4 Table 3.14.byte[]getUserKey()Deprecated.This will get the U entry in the standard encryption dictionary.voidsetCanAssembleDocument(boolean allowAssembly)Deprecated.Set if the user can insert/rotate/delete pages.voidsetCanExtractContent(boolean allowExtraction)Deprecated.Set if the user can extract content from the document.voidsetCanExtractForAccessibility(boolean allowExtraction)Deprecated.Set if the user can extract content from the document for accessibility purposes.voidsetCanFillInForm(boolean allowFillingInForm)Deprecated.Set if the user can fill in interactive forms.voidsetCanModify(boolean allowModifications)Deprecated.Set if the user can modify the document.voidsetCanModifyAnnotations(boolean allowAnnotationModification)Deprecated.Set if the user can modify annotations.voidsetCanPrint(boolean allowPrinting)Deprecated.Set if the user can print.voidsetCanPrintDegraded(boolean canPrintDegraded)Deprecated.Set if the user can print the document in a degraded format.voidsetOwnerKey(byte[] o)Deprecated.This will set the O entry in the standard encryption dictionary.voidsetPermissions(int p)Deprecated.This will set the permissions bit mask.voidsetRevision(int revision)Deprecated.This will set the R entry of the encryption dictionary.
See PDF Reference 1.4 Table 3.14.voidsetUserKey(byte[] u)Deprecated.This will set the U entry in the standard encryption dictionary.-
Methods inherited from class org.apache.pdfbox.pdmodel.encryption.PDEncryptionDictionary
getCOSDictionary, getCryptFilterDictionary, getFilter, getLength, getRecipientsLength, getRecipientStringAt, getStdCryptFilterDictionary, getStreamFilterName, getStringFilterName, getSubFilter, getVersion, isEncryptMetaData, setFilter, setLength, setRecipients, setSubFilter, setVersion
-
-
-
-
Field Detail
-
FILTER_NAME
public static final java.lang.String FILTER_NAME
Deprecated.The 'Filter' name for this security handler.- See Also:
- Constant Field Values
-
DEFAULT_REVISION
public static final int DEFAULT_REVISION
Deprecated.The default revision of one is not specified.- See Also:
- Constant Field Values
-
REVISION2
public static final int REVISION2
Deprecated.Encryption revision 2.- See Also:
- Constant Field Values
-
REVISION3
public static final int REVISION3
Deprecated.Encryption revision 3.- See Also:
- Constant Field Values
-
REVISION4
public static final int REVISION4
Deprecated.Encryption revision 4.- See Also:
- Constant Field Values
-
DEFAULT_PERMISSIONS
public static final int DEFAULT_PERMISSIONS
Deprecated.The default set of permissions which is to allow all.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDStandardEncryption
public PDStandardEncryption()
Deprecated.Default constructor that uses Version 2, Revision 3, 40 bit encryption, all permissions allowed.
-
PDStandardEncryption
public PDStandardEncryption(COSDictionary dict)
Deprecated.Constructor from existing dictionary.- Parameters:
dict- The existing encryption dictionary.
-
-
Method Detail
-
getRevision
public int getRevision()
Deprecated.This will return the R entry of the encryption dictionary.
See PDF Reference 1.4 Table 3.14.- Overrides:
getRevisionin classPDEncryptionDictionary- Returns:
- The encryption revision to use.
-
setRevision
public void setRevision(int revision)
Deprecated.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!.- Overrides:
setRevisionin classPDEncryptionDictionary- Parameters:
revision- The new encryption version.
-
getOwnerKey
public byte[] getOwnerKey()
Deprecated.This will get the O entry in the standard encryption dictionary.- Overrides:
getOwnerKeyin classPDEncryptionDictionary- Returns:
- A 32 byte array or null if there is no owner key.
-
setOwnerKey
public void setOwnerKey(byte[] o) throws java.io.IOExceptionDeprecated.This will set the O entry in the standard encryption dictionary.- Overrides:
setOwnerKeyin classPDEncryptionDictionary- Parameters:
o- A 32 byte array or null if there is no owner key.- Throws:
java.io.IOException- If there is an error setting the data.
-
getUserKey
public byte[] getUserKey()
Deprecated.This will get the U entry in the standard encryption dictionary.- Overrides:
getUserKeyin classPDEncryptionDictionary- Returns:
- A 32 byte array or null if there is no user key.
-
setUserKey
public void setUserKey(byte[] u) throws java.io.IOExceptionDeprecated.This will set the U entry in the standard encryption dictionary.- Overrides:
setUserKeyin classPDEncryptionDictionary- Parameters:
u- A 32 byte array.- Throws:
java.io.IOException- If there is an error setting the data.
-
getPermissions
public int getPermissions()
Deprecated.This will get the permissions bit mask.- Overrides:
getPermissionsin classPDEncryptionDictionary- Returns:
- The permissions bit mask.
-
setPermissions
public void setPermissions(int p)
Deprecated.This will set the permissions bit mask.- Overrides:
setPermissionsin classPDEncryptionDictionary- Parameters:
p- The new permissions bit mask
-
canPrint
public boolean canPrint()
Deprecated.This will tell if the user can print.- Returns:
- true If supplied with the user password they are allowed to print.
-
setCanPrint
public void setCanPrint(boolean allowPrinting)
Deprecated.Set if the user can print.- Parameters:
allowPrinting- A boolean determining if the user can print.
-
canModify
public boolean canModify()
Deprecated.This will tell if the user can modify contents of the document.- Returns:
- true If supplied with the user password they are allowed to modify the document
-
setCanModify
public void setCanModify(boolean allowModifications)
Deprecated.Set if the user can modify the document.- Parameters:
allowModifications- A boolean determining if the user can modify the document.
-
canExtractContent
public boolean canExtractContent()
Deprecated.This will tell if the user can extract text and images from the PDF document.- Returns:
- true If supplied with the user password they are allowed to extract content from the PDF document
-
setCanExtractContent
public void setCanExtractContent(boolean allowExtraction)
Deprecated.Set if the user can extract content from the document.- Parameters:
allowExtraction- A boolean determining if the user can extract content from the document.
-
canModifyAnnotations
public boolean canModifyAnnotations()
Deprecated.This will tell if the user can add/modify text annotations, fill in interactive forms fields.- Returns:
- true If supplied with the user password they are allowed to modify annotations.
-
setCanModifyAnnotations
public void setCanModifyAnnotations(boolean allowAnnotationModification)
Deprecated.Set if the user can modify annotations.- Parameters:
allowAnnotationModification- A boolean determining if the user can modify annotations.
-
canFillInForm
public boolean canFillInForm()
Deprecated.This will tell if the user can fill in interactive forms.- Returns:
- true If supplied with the user password they are allowed to fill in form fields.
-
setCanFillInForm
public void setCanFillInForm(boolean allowFillingInForm)
Deprecated.Set if the user can fill in interactive forms.- Parameters:
allowFillingInForm- A boolean determining if the user can fill in interactive forms.
-
canExtractForAccessibility
public boolean canExtractForAccessibility()
Deprecated.This will tell if the user can extract text and images from the PDF document for accessibility purposes.- Returns:
- true If supplied with the user password they are allowed to extract content from the PDF document
-
setCanExtractForAccessibility
public void setCanExtractForAccessibility(boolean allowExtraction)
Deprecated.Set if the user can extract content from the document for accessibility purposes.- Parameters:
allowExtraction- A boolean determining if the user can extract content from the document.
-
canAssembleDocument
public boolean canAssembleDocument()
Deprecated.This will tell if the user can insert/rotate/delete pages.- Returns:
- true If supplied with the user password they are allowed to extract content from the PDF document
-
setCanAssembleDocument
public void setCanAssembleDocument(boolean allowAssembly)
Deprecated.Set if the user can insert/rotate/delete pages.- Parameters:
allowAssembly- A boolean determining if the user can assemble the document.
-
canPrintDegraded
public boolean canPrintDegraded()
Deprecated.This will tell if the user can print the document in a degraded format.- Returns:
- true If supplied with the user password they are allowed to print the document in a degraded format.
-
setCanPrintDegraded
public void setCanPrintDegraded(boolean canPrintDegraded)
Deprecated.Set if the user can print the document in a degraded format.- Parameters:
canPrintDegraded- A boolean determining if the user can print the document in a degraded format.
-
-