1 unstable release

0.1.0 Nov 4, 2024

#203 in Unix APIs

GPL-3.0-or-later

35KB
417 lines

ocdm – OpenPGP Certificate Directory Manager

ocdm is a command-line interface for managing OpenPGP Certificate Directories.

Quickstart

Inspecting a Certificate Store

$ ocdm show
OpenPGP Certificate Directory
  Path:              /home/robin/.local/share/pgp.cert.d
  Tag:               b7dac1e26600f804
  Certificate count: 3

Importing Certificates

$ ocdm import /tmp/91ffe0700e80619ceb73235ca88e23e377514e00.asc
Certificate 91ffe0700e80619ceb73235ca88e23e377514e00
  Primary user ID:
    Florian Pritz (Arch Linux Master Key) <florian@master-key.archlinux.org>
Imported certificate 91ffe0700e80619ceb73235ca88e23e377514e00 into store '/home/robin/.local/share/pgp.cert.d'

$ cat /tmp/d8afdda07a5b6edfa7d8ccdad6d055f927843f1c.asc | ocdm import
Certificate d8afdda07a5b6edfa7d8ccdad6d055f927843f1c
  Primary user ID:
    Levente Polyak (Arch Linux Master Key) <anthraxx@master-key.archlinux.org>
Imported certificate d8afdda07a5b6edfa7d8ccdad6d055f927843f1c into store '/home/robin/.local/share/pgp.cert.d'

Listing Certificates

$ ocdm list
91ffe0700e80619ceb73235ca88e23e377514e00 Florian Pritz (Arch Linux Master Key) <florian@master-key.archlinux.org>
d8afdda07a5b6edfa7d8ccdad6d055f927843f1c Levente Polyak (Arch Linux Master Key) <anthraxx@master-key.archlinux.org>
69e6471e3ae065297529832e6ba0f5a2037f4f41 Johannes Löthberg (Arch Linux Master Key) <demize@master-key.archlinux.org>
3572fa2a1b067f22c58af155f8b821b42a6fdcd7 Leonidas Spyropoulos (Arch Linux Master Key) <artafinde@master-key.archlinux.org>
2ac0a42efb0b5cbc7a0402ed4dc95b6d7be9892e David Runge (Arch Linux Master Key) <dvzrv@master-key.archlinux.org>

Searching Certificates

$ ocdm search po
d8afdda07a5b6edfa7d8ccdad6d055f927843f1c Levente Polyak (Arch Linux Master Key) <anthraxx@master-key.archlinux.org>
3572fa2a1b067f22c58af155f8b821b42a6fdcd7 Leonidas Spyropoulos (Arch Linux Master Key) <artafinde@master-key.archlinux.org>

$ ocdm search po leo
3572fa2a1b067f22c58af155f8b821b42a6fdcd7 Leonidas Spyropoulos (Arch Linux Master Key) <artafinde@master-key.archlinux.org>

$ ocdm search po d8
d8afdda07a5b6edfa7d8ccdad6d055f927843f1c Levente Polyak (Arch Linux Master Key) <anthraxx@master-key.archlinux.org>

Inspecting Certificates

$ ocdm show 2ac0a42efb0b5cbc7a0402ed4dc95b6d7be9892e
Certificate 2ac0a42efb0b5cbc7a0402ed4dc95b6d7be9892e
  Primary user ID:
    David Runge (Arch Linux Master Key) <dvzrv@master-key.archlinux.org>

Selecting the Store Location

$ ocdm show --cert-store /tmp/pgp.cert.d
OpenPGP Certificate Directory
  Path:              /tmp/pgp.cert.d
  Tag:               f62163b61ed1bc00
  Certificate count: 1

$ PGP_CERT_D=/tmp/pgp.cert.d ocdm show
OpenPGP Certificate Directory
  Path:              /tmp/pgp.cert.d
  Tag:               f62163b61ed1bc00
  Certificate count: 1

Installation

To install ocdm, you need Rust 1.76.0 or later. Download the source code for the latest release and compile it with:

$ git clone https://codeberg.org/robink/ocdm.git
$ cd ocdm
$ git checkout stable
$ cargo build --release --locked

It is recommended to verify the OpenPGP signature of the release before compiling and installing it:

$ git verify-commit stable

All releases should be signed with the key EC7E F0F9 B681 4C24 6236 3842 B755 6972 702A FD45.

Alternatively, you can install ocdm directly from crates.io:

$ cargo install --locked ocdm

Acknowledgements

ocdm uses the openpgp-cert-d, pgp and rpgpie crates to implement its features. Thanks to their developers for providing the building blocks for this tool!

Contact

For bug reports, feature requests and other messages, please open an issue for the ocdm project on Codeberg.org.

License

This project is licensed under the GNU General Public License, Version 3.0 or later. The documentation and examples contained in this repository are licensed under the Creative Commons Zero license. For more information, see the license header in each file. You can find a copy of the license texts in the LICENSES directory.

ocdm complies with version 3.0 of the REUSE specification.

Dependencies

~21–32MB
~477K SLoC