class BouncyCastleGpgKeyPassphrasePrompt
extends java.lang.Object
implements java.lang.AutoCloseable
cleared
.
Implements AutoCloseable
so it can be used within a
try-with-resources block.
Modifier and Type | Field and Description |
---|---|
private CredentialsProvider |
credentialsProvider |
private CredentialItem.CharArrayType |
passphrase |
Constructor and Description |
---|
BouncyCastleGpgKeyPassphrasePrompt(CredentialsProvider credentialsProvider) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears any cached passphrase
|
void |
close() |
private URIish |
createURI(java.nio.file.Path keyLocation) |
char[] |
getPassphrase(byte[] keyFingerprint,
java.nio.file.Path keyLocation)
Prompts use for a passphrase unless one was cached from a previous
prompt.
|
private CredentialItem.CharArrayType passphrase
private CredentialsProvider credentialsProvider
public BouncyCastleGpgKeyPassphrasePrompt(CredentialsProvider credentialsProvider)
public void clear()
public void close()
close
in interface java.lang.AutoCloseable
private URIish createURI(java.nio.file.Path keyLocation) throws java.net.URISyntaxException
java.net.URISyntaxException
public char[] getPassphrase(byte[] keyFingerprint, java.nio.file.Path keyLocation) throws org.bouncycastle.openpgp.PGPException, CanceledException, UnsupportedCredentialItem, java.net.URISyntaxException
keyFingerprint
- the fingerprint to show to the user during promptingkeyLocation
- the location the key was loaded fromnull
)org.bouncycastle.openpgp.PGPException
CanceledException
- in case passphrase was not entered by userjava.net.URISyntaxException
UnsupportedCredentialItem