| Crates.io | jgpg |
| lib.rs | jgpg |
| version | 0.1.0 |
| created_at | 2025-11-08 11:31:47.067501+00 |
| updated_at | 2025-11-08 11:31:47.067501+00 |
| description | A Rust binary and library for converting gpg --list-keys (apt-key list etc.) output to JSON in DevOps, CI/CD pipelines. |
| homepage | |
| repository | https://github.com/achianumba/jgpg |
| max_upload_size | |
| id | 1922783 |
| size | 41,806 |
A Rust binary and library for converting gpg --list-keys (apt-key list etc.) output to JSON in DevOps, CI/CD pipelines. jgpg parses human-oriented GPG keyring listings into structured JSON, including key metadata, user IDs, trust indicators, and subkeys.
Pipe GPG output into the tool:
From Crates.io
cargo install jgpg
Or as a library
cargo add jgpg
From source
cargo install --git https://github.com/achianumba/jgpg
gpg --list-keys | jgpg
Sample Output
{
"/home/USERNAME/.gnupg/pubring.kbx": [
{
"key_type": "rsa3072",
"created": "2025-08-13",
"can_sign": true,
"can_certify": true,
"can_encrypt": false,
"can_authenticate": false,
"expires": "2027-08-13",
"id": "A6C4C64CCC8E8D4A278660B0A78A721FDBC087D9",
"fingerprint": null,
"trust_level": "ultimate",
"real_name": "testing",
"email": "testing@local",
"sub_keys": [
{
"key_type": "rsa3072",
"created": "2025-08-13",
"can_sign": false,
"can_certify": false,
"can_encrypt": true,
"can_authenticate": false,
"expires": "2027-08-13"
}
]
}
]
}
Get an array of key names stored in /etc/apt/trusted.gpg using jgpg and jq.
apt-key list | cargo run | jq '."/etc/apt/trusted.gpg" | map(.real_name)''
Sample Output
[
"Launchpad PPA for Ubuntu Git Maintainers",
"Launchpad PPA for Janek Bevendorff",
"Launchpad PPA for wereturtle"
]