Expand description
OpenPGP CA functionality as a library
Example usage:
// all state of an OpenPGP CA instance is persisted in one SQLite database
let db_filename = "/tmp/openpgp-ca.sqlite";
// 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"), None)
.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,
None,
false,
None,
true,
true,
false,
)
.unwrap();
Modules§
Structs§
- Oca
- An initialized OpenPGP CA instance, with a configured backend. Oca exposes the main functionality of OpenPGP CA.
- Uninit
- A CA instance that has a database, which is (possibly) not initialized yet. No backend for private key operations is available at this stage.
Constants§
- VERSION
- The version of this crate.
Functions§
- blank_
cards - List of cards that are blank (no fingerprint in any slot)
- matching_
cards - List of cards that match the CA cert
cert