Interface SecretKeyPassphraseProvider
-
- All Known Implementing Classes:
CachingSecretKeyRingProtector
,MapBasedPassphraseProvider
,SolitaryPassphraseProvider
public interface SecretKeyPassphraseProvider
Interface to allow the user to provide aPassphrase
for an encrypted OpenPGP secret key.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Passphrase
getPassphraseFor(Long keyId)
Return a passphrase for the given key.default Passphrase
getPassphraseFor(org.bouncycastle.openpgp.PGPSecretKey secretKey)
Return a passphrase for the given secret key.boolean
hasPassphrase(Long keyId)
-
-
-
Method Detail
-
getPassphraseFor
@Nullable default Passphrase getPassphraseFor(org.bouncycastle.openpgp.PGPSecretKey secretKey)
Return a passphrase for the given secret key. If no record is found, return null. Note: In case of an unprotected secret key, this method must may not return null, but aPassphrase
with a content of null.- Parameters:
secretKey
- secret key- Returns:
- passphrase or null, if no passphrase record is found.
-
getPassphraseFor
@Nullable Passphrase getPassphraseFor(Long keyId)
Return a passphrase for the given key. If no record has been found, return null. Note: In case of an unprotected secret key, this method must may not return null, but aPassphrase
with a content of null.- Parameters:
keyId
- if of the secret key- Returns:
- passphrase or null, if no passphrase record has been found.
-
hasPassphrase
boolean hasPassphrase(Long keyId)
-
-