Package org.faceless.pdf2.viewer2
Class PublicKeyPromptEncryptionHandler
- java.lang.Object
-
- org.faceless.pdf2.EncryptionHandler
-
- org.faceless.pdf2.PublicKeyEncryptionHandler
-
- org.faceless.pdf2.viewer2.PublicKeyPromptEncryptionHandler
-
- All Implemented Interfaces:
Cloneable
public class PublicKeyPromptEncryptionHandler extends PublicKeyEncryptionHandler
An extension of thePublicKeyEncryptionHandler
that will pop up a dialog allowing the user to select a KeyStore to select a private key from if necessary.This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
- Since:
- 2.8.2
-
-
Field Summary
-
Fields inherited from class org.faceless.pdf2.PublicKeyEncryptionHandler
METHOD_AES128, METHOD_AES256, METHOD_AES256_GCM, METHOD_RC4_3DES128, METHOD_RC4_3DES128_OLD
-
-
Constructor Summary
Constructors Constructor Description PublicKeyPromptEncryptionHandler(JComponent parent, KeyStoreManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
chooseRecipient(X500Principal[] issuers, BigInteger[] serials)
This method is called byPublicKeyEncryptionHandler.prepareToDecrypt()
to give an implementation the chance to select an appropriate entry from the KeyStore if it hasn't already been done.void
setAlias(String alias, char[] password)
-
Methods inherited from class org.faceless.pdf2.PublicKeyEncryptionHandler
addRecipient, finishedDecrypt, finishedEncrypt, getChange, getDecryptionStream, getDescription, getEncryptedStreamLength, getEncryptionStream, getExtract, getFilterName, getPrint, getSubFilterName, hasRight, isMetadataEncrypted, isRequired, prepareToDecrypt, prepareToEncrypt, setDecryptionKey, setDecryptionKey, setEncryptedMetadata
-
Methods inherited from class org.faceless.pdf2.EncryptionHandler
clone, containsKey, getArrayValueSize, getBooleanValue, getDecryptedStreamLength, getDictionaryValueKeys, getFileId, getIntegerValue, getNameValue, getNumericValue, getStringValue, getTextStringValue, isChanged, isEmbeddedFileEncrypted, isStreamEncrypted, isStringEncrypted, markChanged, putArrayValue, putBooleanValue, putDictionaryValue, putNameValue, putNumericValue, putStringValue, putTextStringValue, setFileId
-
-
-
-
Constructor Detail
-
PublicKeyPromptEncryptionHandler
public PublicKeyPromptEncryptionHandler(JComponent parent, KeyStoreManager manager)
-
-
Method Detail
-
setAlias
public void setAlias(String alias, char[] password)
-
chooseRecipient
protected boolean chooseRecipient(X500Principal[] issuers, BigInteger[] serials)
Description copied from class:PublicKeyEncryptionHandler
This method is called byPublicKeyEncryptionHandler.prepareToDecrypt()
to give an implementation the chance to select an appropriate entry from the KeyStore if it hasn't already been done. The supplied arrays are equal length and indicate the Issuer and SerialNumber of all the recipients that can decrypt this document. By default this method does nothing.- Overrides:
chooseRecipient
in classPublicKeyEncryptionHandler
- Parameters:
issuers
- an array listing all the X.509 Certificate Issuersserials
- an array listing all the X.509 Certificate Serial Numbers.- Returns:
- true if the decryption should continue, false otherwise
-
-