Package org.pgpainless.sop
Class MatchMakingSecretKeyRingProtector
java.lang.Object
org.pgpainless.sop.MatchMakingSecretKeyRingProtector
- All Implemented Interfaces:
org.pgpainless.key.protection.SecretKeyRingProtector
public class MatchMakingSecretKeyRingProtector
extends Object
implements org.pgpainless.key.protection.SecretKeyRingProtector
Implementation of the
SecretKeyRingProtector which can be handed passphrases and keys separately,
and which then matches up passphrases and keys when needed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPassphrase(org.pgpainless.util.Passphrase passphrase) Add a single passphrase to the protector.voidaddSecretKey(org.bouncycastle.openpgp.PGPSecretKeyRing key) Add a singlePGPSecretKeyRingto the protector.voidclear()Clear all known passphrases from the protector.org.bouncycastle.openpgp.operator.PBESecretKeyDecryptorgetDecryptor(Long keyId) org.bouncycastle.openpgp.operator.PBESecretKeyEncryptorgetEncryptor(Long keyId) booleanhasPassphraseFor(Long keyId)
-
Constructor Details
-
MatchMakingSecretKeyRingProtector
public MatchMakingSecretKeyRingProtector()
-
-
Method Details
-
addPassphrase
public void addPassphrase(org.pgpainless.util.Passphrase passphrase) Add a single passphrase to the protector.- Parameters:
passphrase- passphrase
-
addSecretKey
public void addSecretKey(org.bouncycastle.openpgp.PGPSecretKeyRing key) Add a singlePGPSecretKeyRingto the protector.- Parameters:
key- secret keys
-
hasPassphraseFor
- Specified by:
hasPassphraseForin interfaceorg.pgpainless.key.protection.SecretKeyRingProtector
-
getDecryptor
@Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor getDecryptor(Long keyId) throws org.bouncycastle.openpgp.PGPException - Specified by:
getDecryptorin interfaceorg.pgpainless.key.protection.SecretKeyRingProtector- Throws:
org.bouncycastle.openpgp.PGPException
-
getEncryptor
@Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor getEncryptor(Long keyId) throws org.bouncycastle.openpgp.PGPException - Specified by:
getEncryptorin interfaceorg.pgpainless.key.protection.SecretKeyRingProtector- Throws:
org.bouncycastle.openpgp.PGPException
-
clear
public void clear()Clear all known passphrases from the protector.
-