#open-pgp #sequoia #pgp

openpgp-ca-lib

OpenPGP CA is a tool for managing and certifying OpenPGP keys

7 releases

0.12.1 Feb 14, 2023
0.12.0 Feb 3, 2023
0.12.0-alpha.1 Nov 22, 2022
0.11.3 Sep 20, 2022
0.10.1 May 7, 2021

#828 in Cryptography

Download history 15/week @ 2022-11-30 15/week @ 2022-12-07 9/week @ 2022-12-14 11/week @ 2022-12-21 10/week @ 2022-12-28 3/week @ 2023-01-04 9/week @ 2023-01-11 11/week @ 2023-01-18 13/week @ 2023-01-25 41/week @ 2023-02-01 27/week @ 2023-02-08 52/week @ 2023-02-15 11/week @ 2023-02-22 6/week @ 2023-03-01 15/week @ 2023-03-08 23/week @ 2023-03-15

65 downloads per month
Used in 2 crates

GPL-3.0-or-later

155KB
3K SLoC

OpenPGP CA functionality as a library

Example usage:

# use openpgp_ca_lib::Uninit;
# use tempfile;
// all state of an OpenPGP CA instance is persisted in one SQLite database
let db_filename = "/tmp/openpgp-ca.sqlite";
# // for Doc-tests we need a random database filename
# let file = tempfile::NamedTempFile::new().unwrap();
# let db_filename = file.path().to_str().unwrap();

// Set up a new, uninitialized OpenPGP CA database
// (implicitly creates the database file).
let ca_uninit = Uninit::new(Some(db_filename)).expect("Failed to set up CA");

// Initialize the CA, create the CA key (with domain name and descriptive name)
let ca = ca_uninit
    .init_softkey("example.org", Some("Example Org OpenPGP CA Key"))
    .unwrap();

// Create a new user, certified by the CA, and a trust signature by the user
// key on the CA key.
//
// The new private key for the user is printed to stdout and needs to be manually
// processed from there.
ca.user_new(Some(&"Alice"), &["alice@example.org"], None, false, false)
    .unwrap();

Dependencies

~53MB
~1M SLoC