pub struct Pkcs11Instance {
pub config: Config,
/* private fields */
}Expand description
One open PKCS#11-backed keystore connection.
Owns the cryptoki client and the live session. Both are
Send + Sync (the underlying PKCS#11 module was initialised with
CKF_OS_LOCKING_OK), so the trait object is sound without a manual
unsafe impl.
Fields§
§config: ConfigResolved configuration parsed from Options at open time.
Trait Implementations§
Source§impl StoreInstance for Pkcs11Instance
impl StoreInstance for Pkcs11Instance
Source§fn put_secret(
&mut self,
_module: &str,
_app: &str,
_key_id: &str,
_key: *mut c_void,
) -> Result<()>
fn put_secret( &mut self, _module: &str, _app: &str, _key_id: &str, _key: *mut c_void, ) -> Result<()>
Insert a secret key into the private compartment, indexed by
key_id.Source§fn get_secret(
&self,
_module: &str,
_app: &str,
_key_id: &str,
) -> Result<*mut c_void>
fn get_secret( &self, _module: &str, _app: &str, _key_id: &str, ) -> Result<*mut c_void>
Fetch a secret key from the private compartment by
key_id.
Returns crate::error::Error::ValueNotFound if absent.Source§fn put_public(
&mut self,
_module: &str,
_app: &str,
_identity: &str,
_key: *mut c_void,
_sig: &[u8],
) -> Result<()>
fn put_public( &mut self, _module: &str, _app: &str, _identity: &str, _key: *mut c_void, _sig: &[u8], ) -> Result<()>
Insert a public key into the public compartment, indexed by
identity, with a detached signature over the identity.Source§fn get_public(
&self,
_module: &str,
_app: &str,
_identity: &str,
) -> Result<(*mut c_void, Vec<u8>)>
fn get_public( &self, _module: &str, _app: &str, _identity: &str, ) -> Result<(*mut c_void, Vec<u8>)>
Fetch a public key from the public compartment by
identity.
Returns the key handle and the stored signature bytes.Source§fn enumerate(
&self,
_module: &str,
_app: &str,
_compartment: Compartment,
) -> Result<Vec<(*mut c_void, String)>>
fn enumerate( &self, _module: &str, _app: &str, _compartment: Compartment, ) -> Result<Vec<(*mut c_void, String)>>
Enumerate entries in one compartment of one
(module, app)
scope. Each entry is the opaque key handle paired with its index
string (key_id for private, canonical identity for public).Source§fn sign(
&self,
_module: &str,
_app: &str,
_key_id: &str,
_algorithm: &str,
_message: &[u8],
) -> Result<Vec<u8>, Error>
fn sign( &self, _module: &str, _app: &str, _key_id: &str, _algorithm: &str, _message: &[u8], ) -> Result<Vec<u8>, Error>
Sign
message with the remote key named by key_id, using the
provider-specific algorithm name (e.g. "ECDSA_SHA_256" on
AWS KMS, "EC_SIGN_P256_SHA256" on Cloud KMS, "ES256" on Key
Vault). Input is the raw message — providers that sign digests
hash it themselves or the backend does. This is the remote-sign
half of the sign-with-handle contract: backends that hold keys
out-of-process (cloud KMS, PKCS#11, TPM) implement it; local
backends keep the default.impl Sync for Pkcs11Instance
Auto Trait Implementations§
impl !Freeze for Pkcs11Instance
impl !RefUnwindSafe for Pkcs11Instance
impl !UnwindSafe for Pkcs11Instance
impl Send for Pkcs11Instance
impl Unpin for Pkcs11Instance
impl UnsafeUnpin for Pkcs11Instance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more