Package org.pgpainless.key.protection
Class PasswordBasedSecretKeyRingProtector
- java.lang.Object
-
- org.pgpainless.key.protection.BaseSecretKeyRingProtector
-
- org.pgpainless.key.protection.PasswordBasedSecretKeyRingProtector
-
- All Implemented Interfaces:
SecretKeyRingProtector
public class PasswordBasedSecretKeyRingProtector extends BaseSecretKeyRingProtector
ProvidesPBESecretKeyDecryptor
andPBESecretKeyEncryptor
objects while getting the passphrases from aSecretKeyPassphraseProvider
and using settings from anKeyRingProtectionSettings
.
-
-
Constructor Summary
Constructors Constructor Description PasswordBasedSecretKeyRingProtector(KeyRingProtectionSettings settings, SecretKeyPassphraseProvider passphraseProvider)
Constructor.PasswordBasedSecretKeyRingProtector(SecretKeyPassphraseProvider passphraseProvider)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PasswordBasedSecretKeyRingProtector
forKey(org.bouncycastle.openpgp.PGPKeyRing keyRing, Passphrase passphrase)
static PasswordBasedSecretKeyRingProtector
forKey(org.bouncycastle.openpgp.PGPSecretKey key, Passphrase passphrase)
static PasswordBasedSecretKeyRingProtector
forKeyId(long singleKeyId, Passphrase passphrase)
-
Methods inherited from class org.pgpainless.key.protection.BaseSecretKeyRingProtector
getDecryptor, getEncryptor, hasPassphraseFor
-
-
-
-
Constructor Detail
-
PasswordBasedSecretKeyRingProtector
public PasswordBasedSecretKeyRingProtector(@Nonnull SecretKeyPassphraseProvider passphraseProvider)
-
PasswordBasedSecretKeyRingProtector
public PasswordBasedSecretKeyRingProtector(@Nonnull KeyRingProtectionSettings settings, @Nonnull SecretKeyPassphraseProvider passphraseProvider)
Constructor. Passphrases for keys are sourced from thepassphraseProvider
and decryptors/encryptors are constructed following the settings given insettings
.- Parameters:
settings
- S2K settings etc.passphraseProvider
- provider which provides passphrases.
-
-
Method Detail
-
forKey
public static PasswordBasedSecretKeyRingProtector forKey(org.bouncycastle.openpgp.PGPKeyRing keyRing, Passphrase passphrase)
-
forKey
public static PasswordBasedSecretKeyRingProtector forKey(org.bouncycastle.openpgp.PGPSecretKey key, Passphrase passphrase)
-
forKeyId
public static PasswordBasedSecretKeyRingProtector forKeyId(long singleKeyId, Passphrase passphrase)
-
-