Package org.pgpainless.key.protection
Class UnprotectedKeysProtector
java.lang.Object
org.pgpainless.key.protection.UnprotectedKeysProtector
- All Implemented Interfaces:
SecretKeyRingProtector
Implementation of the
SecretKeyRingProtector
which assumes that all handled keys are not password protected.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.openpgp.operator.PBESecretKeyDecryptor
getDecryptor
(Long keyId) Return a decryptor for the key of idkeyId
.org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor
getEncryptor
(Long keyId) Return an encryptor for the key of idkeyId
.boolean
hasPassphraseFor
(Long keyId)
-
Constructor Details
-
UnprotectedKeysProtector
public UnprotectedKeysProtector()
-
-
Method Details
-
hasPassphraseFor
- Specified by:
hasPassphraseFor
in interfaceSecretKeyRingProtector
-
getDecryptor
Description copied from interface:SecretKeyRingProtector
Return a decryptor for the key of idkeyId
. This method returns null if the key is unprotected.- Specified by:
getDecryptor
in interfaceSecretKeyRingProtector
- Parameters:
keyId
- id of the key- Returns:
- decryptor for the key
-
getEncryptor
Description copied from interface:SecretKeyRingProtector
Return an encryptor for the key of idkeyId
. This method returns null if the key is unprotected.- Specified by:
getEncryptor
in interfaceSecretKeyRingProtector
- Parameters:
keyId
- id of the key- Returns:
- encryptor for the key
-