Crate openpgp_pkcs11_sequoia

Crate openpgp_pkcs11_sequoia 

Source
Expand description

Library for PKCS #11 HSM usage with Sequoia PGP.

Example use, uploading an OpenPGP key to a PKCS #11 device:

use openpgp_pkcs11_sequoia::Op11;

// PKCS #11 driver module
let module = "/usr/lib64/pkcs11/yubihsm_pkcs11.so";

// Serial of the PKCS #11 slot
let serial = "07550916";

// Open PKCS #11 context and slot
let mut pkcs11 = Op11::open(module)?;
let slot = pkcs11.slot(serial)?;

// Open a read-write session, log in as user
let session = slot.open_rw_session()?;
session.login("0001password")?;

// Upload an OpenPGP component key to the PKCS #11 device as id "3"
session.upload_key(&[3], &pgp_key, &common_name)?;

Structsยง

Op11
OpenPGP PKCS #11 context
Op11KeyPair
PKCS #11 implementation of sequoia_openpgp::crypto::Signer and sequoia_openpgp::crypto::Decryptor, as well as sequoia_openpgp::parse::stream::DecryptionHelper and sequoia_openpgp::parse::stream::VerificationHelper.
Op11Session
OpenPGP PKCS #11 Session
Op11Slot
OpenPGP PKCS #11 Slot