|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfbox.encryption.DocumentEncryption
public class DocumentEncryption
This class will deal with encrypting/decrypting a document.
Constructor Summary | |
---|---|
DocumentEncryption(COSDocument doc)
Constructor. |
|
DocumentEncryption(PDDocument doc)
Constructor. |
Method Summary | |
---|---|
void |
decryptDocument(String password)
This will decrypt the document. |
void |
decryptStream(COSStream stream,
long objNum,
long genNum)
This will decrypt a stream. |
void |
decryptString(COSString string,
long objNum,
long genNum)
This will decrypt a string. |
void |
initForEncryption()
This will encrypt the given document, given the owner password and user password. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentEncryption(PDDocument doc)
doc
- The document to decrypt.public DocumentEncryption(COSDocument doc)
doc
- The document to decrypt.Method Detail |
---|
public void initForEncryption() throws CryptographyException, IOException
CryptographyException
- If an error occurs during encryption.
IOException
- If there is an error accessing the data.public void decryptDocument(String password) throws CryptographyException, IOException, InvalidPasswordException
password
- The password for the document.
CryptographyException
- If there is an error decrypting the document.
IOException
- If there is an error getting the stream data.
InvalidPasswordException
- If the password is not a user or owner password.public void decryptStream(COSStream stream, long objNum, long genNum) throws CryptographyException, IOException
stream
- The stream to decrypt.objNum
- The object number.genNum
- The object generation number.
CryptographyException
- If there is an error getting the stream.
IOException
- If there is an error getting the stream data.public void decryptString(COSString string, long objNum, long genNum) throws CryptographyException, IOException
string
- the string to decrypt.objNum
- The object number.genNum
- The object generation number.
CryptographyException
- If an error occurs during decryption.
IOException
- If an error occurs writing the new string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |