public final class PublicKeySecurityHandler extends SecurityHandler
to see how to protect document with this security handler.
Modifier and Type | Field and Description |
---|---|
static String |
FILTER
The filter name.
|
encryptionKey, keyLength
Constructor and Description |
---|
PublicKeySecurityHandler()
Constructor.
|
PublicKeySecurityHandler(PublicKeyProtectionPolicy p)
Constructor used for encryption.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasProtectionPolicy()
Returns whether a protection policy has been set.
|
void |
prepareDocumentForEncryption(PDDocument doc)
Prepare the document for encryption.
|
void |
prepareForDecryption(PDEncryption encryption,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial)
Prepares everything to decrypt the document.
|
decrypt, decryptStream, encryptDataRC4, encryptDataRC4, encryptStream, encryptString, getCurrentAccessPermission, getKeyLength, isAES, setAES, setCurrentAccessPermission, setDecryptMetadata, setKeyLength
public static final String FILTER
public PublicKeySecurityHandler()
public PublicKeySecurityHandler(PublicKeyProtectionPolicy p)
p
- The protection policy.public void prepareForDecryption(PDEncryption encryption, COSArray documentIDArray, DecryptionMaterial decryptionMaterial) throws IOException
prepareForDecryption
in class SecurityHandler
encryption
- encryption dictionary, can be retrieved via
PDDocument.getEncryption()
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. If verbose mode
is enabled, the exception message will provide more details why the
match wasn't successful.public void prepareDocumentForEncryption(PDDocument doc) throws IOException
prepareDocumentForEncryption
in class SecurityHandler
doc
- The document that will be encrypted.IOException
- If there is an error while encrypting.public boolean hasProtectionPolicy()
hasProtectionPolicy
in class SecurityHandler
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.