8 releases

0.2.3 May 19, 2023
0.2.1 May 2, 2023
0.1.4 Apr 13, 2023

#2 in #anything-except

Download history 9/week @ 2023-11-01 2/week @ 2023-11-08 9/week @ 2023-11-15 8/week @ 2023-11-22 26/week @ 2023-11-29 8/week @ 2023-12-13 8/week @ 2023-12-20 16/week @ 2023-12-27 1/week @ 2024-01-10 9/week @ 2024-01-24 10/week @ 2024-01-31 1/week @ 2024-02-07 64/week @ 2024-02-14

84 downloads per month

Apache-2.0 and LGPL-2.0-or-later

20KB
307 lines

pgpkeydump

CI Crates.io

A tool for dumping PGP keys as JSON.

Installation

From crates:

cargo install pgpkeydump

If the build fails, then you might need nettle. For macOS:

brew install nettle

Usage

pgpkeydump somekey.asc

Both ASCII-armored and binary inputs should work. If the filename argument is omitted, standard input is read instead. Output always goes to standard output.

Example

pgpkeydump \
  <(curl https://keys.openpgp.org/vks/v1/by-keyid/85AE00C504833B3C)

Why?

PGP is a miserable ecosystem, and there is no good way to get a machine-readable representation of a PGP message without mucking through either an unstable textual CLI output or parsing individual PGP packets.

This tool exists solely to take a key-shaped PGP message and dump (some of) its contents. It doesn't support anything else, will never support anything else, and will never attempt to actually verify the authenticity or integrity of its inputs. It is not suitable for use for anything except exploration of a PGP key message's internals.

Alternatives

If this tool doesn't do what you want, then the closest alternatives are:

  • pgpdump, which is semi-maintained but only provides a textual output (and crashes for me on all kinds of reasonable inputs);
  • sq packet dump, which is maintained but only provides a textual output.
  • gpg --list-packets or gpg --with-colons: Good luck!

Dependencies

~13–23MB
~309K SLoC