public final class PublicKeySecurityHandler extends SecurityHandler<PublicKeyProtectionPolicy>
to see how to protect document with this security handler.| Constructor and Description |
|---|
PublicKeySecurityHandler()
Constructor.
|
PublicKeySecurityHandler(PublicKeyProtectionPolicy publicKeyProtectionPolicy)
Constructor used for encryption.
|
| Modifier and Type | Method and Description |
|---|---|
void |
prepareDocumentForEncryption(PDDocument doc)
Prepare the document for encryption.
|
void |
prepareForDecryption(PDEncryption encryption,
COSArray documentIDArray,
DecryptionMaterial decryptionMaterial)
Prepares everything to decrypt the document.
|
computeVersionNumber, decrypt, decryptStream, encryptDataRC4, encryptDataRC4, encryptStream, encryptString, getCurrentAccessPermission, getEncryptionKey, getKeyLength, getProtectionPolicy, hasProtectionPolicy, isAES, isDecryptMetadata, setAES, setCurrentAccessPermission, setCustomSecureRandom, setDecryptMetadata, setEncryptionKey, setKeyLength, setProtectionPolicy, setStreamFilterName, setStringFilterNamepublic static final String FILTER
public PublicKeySecurityHandler()
public PublicKeySecurityHandler(PublicKeyProtectionPolicy publicKeyProtectionPolicy)
publicKeyProtectionPolicy - The protection policy.public void prepareForDecryption(PDEncryption encryption, COSArray documentIDArray, DecryptionMaterial decryptionMaterial) throws IOException
prepareForDecryption in class SecurityHandler<PublicKeyProtectionPolicy>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<PublicKeyProtectionPolicy>doc - The document that will be encrypted.IOException - If there is an error while encrypting.Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.