Package org.pgpainless.key.protection
Class BaseSecretKeyRingProtector
java.lang.Object
org.pgpainless.key.protection.BaseSecretKeyRingProtector
- All Implemented Interfaces:
SecretKeyRingProtector
- Direct Known Subclasses:
PasswordBasedSecretKeyRingProtector
-
Constructor Summary
ConstructorsConstructorDescriptionBaseSecretKeyRingProtector(SecretKeyPassphraseProvider passphraseProvider) BaseSecretKeyRingProtector(SecretKeyPassphraseProvider passphraseProvider, KeyRingProtectionSettings protectionSettings) -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.openpgp.operator.PBESecretKeyDecryptorgetDecryptor(Long keyId) Return a decryptor for the key of idkeyId.org.bouncycastle.openpgp.operator.PBESecretKeyEncryptorgetEncryptor(Long keyId) Return an encryptor for the key of idkeyId.booleanhasPassphraseFor(Long keyId)
-
Constructor Details
-
BaseSecretKeyRingProtector
-
BaseSecretKeyRingProtector
public BaseSecretKeyRingProtector(SecretKeyPassphraseProvider passphraseProvider, KeyRingProtectionSettings protectionSettings)
-
-
Method Details
-
hasPassphraseFor
- Specified by:
hasPassphraseForin interfaceSecretKeyRingProtector
-
getDecryptor
@Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor getDecryptor(Long keyId) throws org.bouncycastle.openpgp.PGPException Description copied from interface:SecretKeyRingProtectorReturn a decryptor for the key of idkeyId. This method returns null if the key is unprotected.- Specified by:
getDecryptorin interfaceSecretKeyRingProtector- Parameters:
keyId- id of the key- Returns:
- decryptor for the key
- Throws:
org.bouncycastle.openpgp.PGPException- if the decryptor cannot be created for some reason
-
getEncryptor
@Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor getEncryptor(Long keyId) throws org.bouncycastle.openpgp.PGPException Description copied from interface:SecretKeyRingProtectorReturn an encryptor for the key of idkeyId. This method returns null if the key is unprotected.- Specified by:
getEncryptorin interfaceSecretKeyRingProtector- Parameters:
keyId- id of the key- Returns:
- encryptor for the key
- Throws:
org.bouncycastle.openpgp.PGPException- if the encryptor cannot be created for some reason
-