|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.pdf.object.PDFObject
org.foray.pdf.object.PDFEncryption
public class PDFEncryption
class representing a /Filter /Standard object.
Nested Class Summary | |
---|---|
class |
PDFEncryption.EncryptionFilter
Private inner class for the encryption filter. |
Field Summary | |
---|---|
static int |
PERMISSION_COPY_CONTENT
Constant for content extraction permission. |
static int |
PERMISSION_EDIT_ANNOTATIONS
Constant for annotation editing permission. |
static int |
PERMISSION_EDIT_CONTENT
Constant for content editing permission. |
static int |
PERMISSION_PRINT
Constant for printing permission. |
Fields inherited from class org.foray.pdf.object.PDFObject |
---|
EOL, MSG_EOL, XREF_EOL |
Constructor Summary | |
---|---|
PDFEncryption(PDFDocument doc)
Create a /Filter /Standard object. |
Method Summary | |
---|---|
byte[] |
encryptData(byte[] data,
int number,
int generation)
This method encrypts the passed data using the generated keys. |
static boolean |
encryptionAvailable()
Indicates whether encryption is available in the current environment. |
byte[] |
getFileID()
Returns the document file ID. |
String |
getFileID(int index)
This method returns the indexed file ID. |
String |
getOwnerPassword()
Returns the owner password for the PDF. |
String |
getUserPassword()
Returns the current user password. |
void |
init()
Initializes the encryption algorithms and values. |
OutputStream |
makeFilter(OutputStream outputStream)
Creates PSEncodeFilter for the encryption object. |
void |
setAllowCopyContent(boolean value)
|
void |
setAllowEditAnnotation(boolean value)
Set whether the document will allow annotation modifications. |
void |
setAllowEditContent(boolean value)
|
void |
setAllowPrint(boolean value)
|
void |
setOwnerPassword(String value)
|
void |
setUserPassword(String value)
|
String |
toPDF()
Generates the PDF text necessary to represent the object, returning it as a String. |
Methods inherited from class org.foray.pdf.object.PDFObject |
---|
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PERMISSION_PRINT
public static final int PERMISSION_EDIT_CONTENT
public static final int PERMISSION_COPY_CONTENT
public static final int PERMISSION_EDIT_ANNOTATIONS
Constructor Detail |
---|
public PDFEncryption(PDFDocument doc)
doc
- The parent PDF document.Method Detail |
---|
public void setUserPassword(String value)
setUserPassword
in interface org.axsl.pdf.PdfEncryption
public String getUserPassword()
public void setOwnerPassword(String value)
setOwnerPassword
in interface org.axsl.pdf.PdfEncryption
public String getOwnerPassword()
public void setAllowPrint(boolean value)
setAllowPrint
in interface org.axsl.pdf.PdfEncryption
public void setAllowCopyContent(boolean value)
setAllowCopyContent
in interface org.axsl.pdf.PdfEncryption
public void setAllowEditContent(boolean value)
setAllowEditContent
in interface org.axsl.pdf.PdfEncryption
public void setAllowEditAnnotation(boolean value)
setAllowEditAnnotation
in interface org.axsl.pdf.PdfEncryption
value
- The new permission value.public byte[] getFileID()
public String getFileID(int index)
index
- The index to access the file ID.
public void init()
init
in interface org.axsl.pdf.PdfEncryption
public byte[] encryptData(byte[] data, int number, int generation)
data
- The data to be encryptednumber
- The block numbergeneration
- The block generation
public OutputStream makeFilter(OutputStream outputStream)
outputStream
- The output stream to which the encrypted data should
be written.
public String toPDF()
PDFObject
public static boolean encryptionAvailable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |