jgpg 0.1.0

A Rust binary and library for converting gpg --list-keys (apt-key list etc.) output to JSON in DevOps, CI/CD pipelines.
Documentation
<!-- This file was autogenerated using the repository configuration tool at https://github.com/achianumba/cgr
ALL MANUAL CHANGES WILL BE OVERWRITTEN THE NEXT TIME THE TOOL RUNS AGAINST THIS REPOSITORY!!!
-->
# jgpg

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.

## Usage

Pipe GPG output into the tool:

## Installation

**From Crates.io**

```shell
cargo install jgpg
```

Or as a library

```shell
cargo add jgpg
```

**From source**

```shell
cargo install --git https://github.com/achianumba/jgpg
```

## Usage

```shell
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`.**

```shell
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"
]
```