Class SecretKeys
java.lang.Object
org.eclipse.jgit.gpg.bc.internal.keys.SecretKeys
Utilities for reading GPG secret keys from a gpg-agent key file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSomething that can supply a passphrase to decrypt an encrypted secret key. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.openpgp.PGPSecretKeyreadSecretKey(InputStream in, org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider calculatorProvider, SecretKeys.PassphraseSupplier passphraseSupplier, org.bouncycastle.openpgp.PGPPublicKey publicKey) Reads a GPG secret key from the given stream.
-
Method Details
-
readSecretKey
public static org.bouncycastle.openpgp.PGPSecretKey readSecretKey(InputStream in, org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider calculatorProvider, SecretKeys.PassphraseSupplier passphraseSupplier, org.bouncycastle.openpgp.PGPPublicKey publicKey) throws IOException, org.bouncycastle.openpgp.PGPException, CanceledException, UnsupportedCredentialItem, URISyntaxException Reads a GPG secret key from the given stream.- Parameters:
in-InputStreamto read from, doesn't need to be bufferedcalculatorProvider- for checking digestspassphraseSupplier- for decrypting encrypted keyspublicKey- the secret key should be for- Returns:
- the secret key
- Throws:
IOException- if the stream cannot be parsedorg.bouncycastle.openpgp.PGPException- if thrown by the underlying S-Expression parser, for instance when the passphrase is wrongCanceledException- if thrown by thepassphraseSupplierUnsupportedCredentialItem- if thrown by thepassphraseSupplierURISyntaxException- if thrown by thepassphraseSupplier
-