|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdmodel.encryption.SecurityHandler
org.apache.pdfbox.pdmodel.encryption.PublicKeySecurityHandler
public class PublicKeySecurityHandler
This class implements the public key security handler described in the PDF specification.
Spec 1.6 p104
,
to see how to protect document with this security handler.
Field Summary | |
---|---|
static String |
FILTER
The filter name. |
Fields inherited from class org.apache.pdfbox.pdmodel.encryption.SecurityHandler |
---|
currentAccessPermission, document, encryptionKey, keyLength, rc4, version |
Constructor Summary | |
---|---|
PublicKeySecurityHandler()
Constructor. |
|
PublicKeySecurityHandler(PublicKeyProtectionPolicy p)
Constructor used for encryption. |
Method Summary | |
---|---|
void |
decryptDocument(PDDocument doc,
DecryptionMaterial decryptionMaterial)
Decrypt the document. |
void |
prepareDocumentForEncryption(PDDocument doc)
Prepare the document for encryption. |
void |
prepareForDecryption(PDEncryptionDictionary encDictionary,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial)
Prepares everything to decrypt the document. |
Methods inherited from class org.apache.pdfbox.pdmodel.encryption.SecurityHandler |
---|
decryptStream, decryptString, encryptData, encryptData, encryptStream, getCurrentAccessPermission, getKeyLength, isAES, proceedDecryption, setAES, setKeyLength |
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
Constructor Detail |
---|
public PublicKeySecurityHandler()
public PublicKeySecurityHandler(PublicKeyProtectionPolicy p)
p
- The protection policy.Method Detail |
---|
public void decryptDocument(PDDocument doc, DecryptionMaterial decryptionMaterial) throws CryptographyException, IOException
decryptDocument
in class SecurityHandler
doc
- The document to decrypt.decryptionMaterial
- The data used to decrypt the document.
CryptographyException
- If there is an error during decryption.
IOException
- If there is an error accessing data.public void prepareForDecryption(PDEncryptionDictionary encDictionary, COSArray documentIDArray, DecryptionMaterial decryptionMaterial) throws CryptographyException, IOException
decryptDocument(PDDocument, DecryptionMaterial)
is used, this method is
called from there. Only if decryption of single objects is needed this should be called instead.
prepareForDecryption
in class SecurityHandler
encDictionary
- encryption dictionary, can be retrieved via PDDocument.getEncryptionDictionary()
documentIDArray
- document id which is returned via COSDocument#getDocumentID()
(not used by this handler)decryptionMaterial
- Information used to decrypt the document.
IOException
- If there is an error accessing data.
CryptographyException
- If there is an error with decryption.public void prepareDocumentForEncryption(PDDocument doc) throws CryptographyException
prepareDocumentForEncryption
in class SecurityHandler
doc
- The document that will be encrypted.
CryptographyException
- If there is an error while encrypting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |