~/.gnupg/private-keys-v1.d or
~/.gnupg/secring.gpg
| Modifier and Type | Class and Description |
|---|---|
| private static class | BouncyCastleGpgKeyLocator.
Thrown if a keybox file exists but doesn't contain an OpenPGP key. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Path | |
| private static final Logger | |
| private BouncyCastleGpgKeyPassphrasePrompt | |
| private final String | |
| private static final Path | |
| private static final Path | |
| private static final Path | |
| private static final Path |
| Access | Constructor and Description |
|---|---|
| public | BouncyCastleGpgKeyLocator(String
the signing key to search for signingKey, BouncyCastleGpgKeyPassphrasePrompt the provider to use when asking for key passphrase passphrasePrompt)Create a new key locator for the specified signing key. |
| Modifier and Type | Method and Description |
|---|---|
| private PGPSecretKey | attemptParseSecretKey(Path keyFile, PGPDigestCalculatorProvider calculatorProvider, SecretKeys.
|
| private static Path | |
| private static boolean | |
| pack-priv static boolean | Returns: whether theuserId matchesof a key userId, String GPG key identification signingKeySpec)Checks whether a given OpenPGP |
| private static Path | |
| pack-priv static BouncyCastleGpgPublicKey | |
| private static PGPPublicKey | |
| private static PGPPublicKey | |
| private static BouncyCastleGpgPublicKey | Returns: publicKey the public key (maybenull)the KeyBox file keyboxFile, String to look for, may be null keyId, String to look for keySpec)Finds a public key associated with the signing key. |
| private static BouncyCastleGpgPublicKey | Returns: the PGP public key, ornull if none foundto search pubringFile, String to look for, may be null keyId, String to look for keySpec)Return the first public key matching the key id ( |
| private static BouncyCastleGpgPublicKey | |
| public BouncyCastleGpgKey | Returns: the secret keyIf there is a private key directory containing keys, use pubring.kbx or pubring.gpg to find the public key; then try to find the secret key in the directory. |
| private BouncyCastleGpgKey | |
| private PGPSecretKey | Returns: the first suitable PGP secret key found for signingthe signing key signingKeyName, Path the secring file secringFile)Return the first suitable key for signing in the key ring collection. |
| private static PGPPublicKey | |
| private static PGPPublicKey | |
| private boolean | |
| private static boolean | |
| private BouncyCastleGpgKey | |
| private static KeyBox | |
| private static String | |
| private static List |
| GPG_DIRECTORY | back to summary |
|---|---|
| pack-priv static final Path GPG_DIRECTORY | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| passphrasePrompt | back to summary |
|---|---|
| private BouncyCastleGpgKeyPassphrasePrompt passphrasePrompt | |
| signingKey | back to summary |
|---|---|
| private final String signingKey | |
| USER_KEYBOX_PATH | back to summary |
|---|---|
| private static final Path USER_KEYBOX_PATH | |
| USER_PGP_LEGACY_SECRING_FILE | back to summary |
|---|---|
| private static final Path USER_PGP_LEGACY_SECRING_FILE | |
| USER_PGP_PUBRING_FILE | back to summary |
|---|---|
| private static final Path USER_PGP_PUBRING_FILE | |
| USER_SECRET_KEY_DIR | back to summary |
|---|---|
| private static final Path USER_SECRET_KEY_DIR | |
| BouncyCastleGpgKeyLocator | back to summary |
|---|---|
| public BouncyCastleGpgKeyLocator(String signingKey, BouncyCastleGpgKeyPassphrasePrompt passphrasePrompt) Create a new key locator for the specified signing key. The signing key must either be a hex representation of a specific key or a user identity substring (eg., email address). All keys in the KeyBox will be looked up in the order as returned by the KeyBox. A key id will be searched before attempting to find a key by user id.
| |
| attemptParseSecretKey | back to summary |
|---|---|
| private PGPSecretKey attemptParseSecretKey(Path keyFile, PGPDigestCalculatorProvider calculatorProvider, SecretKeys. | |
| checkDirectory | back to summary |
|---|---|
| private static Path checkDirectory(String dir, Function<String, Path> toPath, Consumer<String> warn) | |
| containsIgnoreCase | back to summary |
|---|---|
| private static boolean containsIgnoreCase(String a, String b) | |
| containsSigningKey | back to summary |
|---|---|
| pack-priv static boolean containsSigningKey(String userId, String signingKeySpec) Checks whether a given OpenPGP Not all formats are supported; only formats starting with '=', '<', '@', and '*' are handled. Any other format results in a case-insensitive substring match.
| |
| findGpgDirectory | back to summary |
|---|---|
| private static Path findGpgDirectory() | |
| findPublicKey | back to summary |
|---|---|
| pack-priv static BouncyCastleGpgPublicKey findPublicKey(String fingerprint, String keySpec) throws IOException, PGPException | |
| findPublicKeyByKeyId | back to summary |
|---|---|
| private static PGPPublicKey findPublicKeyByKeyId(KeyBlob keyBlob, String keyId) throws IOException | |
| findPublicKeyByUserId | back to summary |
|---|---|
| private static PGPPublicKey findPublicKeyByUserId(KeyBlob keyBlob, String keySpec) throws IOException | |
| findPublicKeyInKeyBox | back to summary |
|---|---|
| private static BouncyCastleGpgPublicKey findPublicKeyInKeyBox(Path keyboxFile, String keyId, String keySpec) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, NoOpenPgpKeyException Finds a public key associated with the signing key.
| |
| findPublicKeyInPubring | back to summary |
|---|---|
| private static BouncyCastleGpgPublicKey findPublicKeyInPubring(Path pubringFile, String keyId, String keySpec) throws IOException, PGPException Return the first public key matching the key id (
| |
| findPublicKeyInPubring | back to summary |
|---|---|
| private static BouncyCastleGpgPublicKey findPublicKeyInPubring(PGPPublicKeyRing keyRing, String keyId, String keySpec) | |
| findSecretKey | back to summary |
|---|---|
| public BouncyCastleGpgKey findSecretKey() throws IOException, NoSuchAlgorithmException, NoSuchProviderException, PGPException, CanceledException, UnsupportedCredentialItem, URISyntaxException If there is a private key directory containing keys, use pubring.kbx or pubring.gpg to find the public key; then try to find the secret key in the directory. If there is no private key directory (or it doesn't contain any keys), try to find the key in secring.gpg directly.
| |
| findSecretKeyForKeyBoxPublicKey | back to summary |
|---|---|
| private BouncyCastleGpgKey findSecretKeyForKeyBoxPublicKey(PGPPublicKey publicKey, Path userKeyboxPath) throws PGPException, CanceledException, UnsupportedCredentialItem, URISyntaxException | |
| findSecretKeyInLegacySecring | back to summary |
|---|---|
| private PGPSecretKey findSecretKeyInLegacySecring(String signingKeyName, Path secringFile) throws IOException, PGPException Return the first suitable key for signing in the key ring collection. For this case we only expect there to be one key available for signing.
| |
| getPublicKey | back to summary |
|---|---|
| private static PGPPublicKey getPublicKey(KeyBlob blob, byte[] fingerprint) throws IOException | |
| getSigningPublicKey | back to summary |
|---|---|
| private static PGPPublicKey getSigningPublicKey(KeyBlob blob) throws IOException | |
| hasKeyFiles | back to summary |
|---|---|
| private boolean hasKeyFiles(Path dir) | |
| isSigningKey | back to summary |
|---|---|
| private static boolean isSigningKey(PGPPublicKey key) | |
| loadKeyFromSecring | back to summary |
|---|---|
| private BouncyCastleGpgKey loadKeyFromSecring(Path secring) throws IOException, PGPException | |
| readKeyBoxFile | back to summary |
|---|---|
| private static KeyBox readKeyBoxFile(Path keyboxFile) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, NoOpenPgpKeyException | |
| toFingerprint | back to summary |
|---|---|
| private static String toFingerprint(String keyId) | |
| toStrings | back to summary |
|---|---|
| private static List | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NoOpenPgpKeyException | back to summary |
|---|---|
| private NoOpenPgpKeyException() | |