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
- OpenPGP PKCS #11 context
- PKCS #11 implementation of
sequoia_openpgp::crypto::Signer
andsequoia_openpgp::crypto::Decryptor
, as well assequoia_openpgp::parse::stream::DecryptionHelper
andsequoia_openpgp::parse::stream::VerificationHelper
. - OpenPGP PKCS #11 Session
- OpenPGP PKCS #11 Slot