public class PDFEncryptionJCE extends PDFObject implements PDFEncryption
Modifier and Type | Field and Description |
---|---|
static int |
PERMISSION_COPY_CONTENT
Value of content extraction permission
|
static int |
PERMISSION_EDIT_ANNOTATIONS
Value of annotation editting permission
|
static int |
PERMISSION_EDIT_CONTENT
Value of content editting permission
|
static int |
PERMISSION_PRINT
Value of PRINT permission
|
DATE_FORMAT, log
Constructor and Description |
---|
PDFEncryptionJCE(int objnum)
Create a /Filter /Standard object.
|
Modifier and Type | Method and Description |
---|---|
void |
applyFilter(AbstractPDFStream stream)
Adds a PDFFilter to the PDFStream object
|
byte[] |
encrypt(byte[] data,
PDFObject refObj)
Encrypt an array of bytes using a reference PDFObject for calculating
the encryption key.
|
byte[] |
encryptData(byte[] data,
int number,
int generation)
This method encrypts the passed data using the generated keys.
|
byte[] |
getFileID()
Returns the document file ID
|
java.lang.String |
getFileID(int index)
This method returns the indexed file ID
|
PDFEncryptionParams |
getParams()
Returns the encryption parameters.
|
java.lang.String |
getTrailerEntry()
Returns the trailer entry for encryption.
|
void |
init()
This method initializes the encryption algorithms and values
|
static PDFEncryption |
make(int objnum,
PDFEncryptionParams params)
Local factory method.
|
PDFFilter |
makeFilter(int number,
int generation)
Creates PDFFilter for the encryption object
|
void |
setParams(PDFEncryptionParams params)
Sets the encryption parameters.
|
byte[] |
toPDF()
Represent the object in PDF
|
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDFString
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
public PDFEncryptionJCE(int objnum)
objnum
- the object's numberpublic static PDFEncryption make(int objnum, PDFEncryptionParams params)
objnum
- PDF object number for the encryption objectparams
- PDF encryption parameterspublic PDFEncryptionParams getParams()
getParams
in interface PDFEncryption
public void setParams(PDFEncryptionParams params)
setParams
in interface PDFEncryption
params
- The parameterss to setpublic byte[] getFileID()
public java.lang.String getFileID(int index)
index
- The index to access the file IDpublic void init()
public byte[] encryptData(byte[] data, int number, int generation)
data
- The data to be encryptednumber
- The block numbergeneration
- The block generationpublic byte[] encrypt(byte[] data, PDFObject refObj)
encrypt
in interface PDFEncryption
data
- data to encryptrefObj
- reference PDFObjectpublic PDFFilter makeFilter(int number, int generation)
number
- The object numbergeneration
- The objects generationpublic void applyFilter(AbstractPDFStream stream)
applyFilter
in interface PDFEncryption
stream
- the stream to add an encryption filter topublic byte[] toPDF()
public java.lang.String getTrailerEntry()
getTrailerEntry
in interface PDFEncryption
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.