Struct ic_identity_hsm::HardwareIdentity
source · pub struct HardwareIdentity { /* private fields */ }
Expand description
An identity based on an HSM
Implementations§
source§impl HardwareIdentity
impl HardwareIdentity
sourcepub fn new<P, PinFn>(
pkcs11_lib_path: P,
slot_index: usize,
key_id: &str,
pin_fn: PinFn
) -> Result<HardwareIdentity, HardwareIdentityError>
pub fn new<P, PinFn>( pkcs11_lib_path: P, slot_index: usize, key_id: &str, pin_fn: PinFn ) -> Result<HardwareIdentity, HardwareIdentityError>
Create an identity using a specific key on an HSM. The filename will be something like /usr/local/lib/opensc-pkcs11.s The key_id must refer to a ECDSA key with parameters prime256v1 (secp256r1) The key must already have been created. You can create one with pkcs11-tool: $ pkcs11-tool -k –slot $SLOT -d $KEY_ID –key-type EC:prime256v1 –pin $PIN
Trait Implementations§
source§impl Debug for HardwareIdentity
impl Debug for HardwareIdentity
source§impl Drop for HardwareIdentity
impl Drop for HardwareIdentity
source§impl Identity for HardwareIdentity
impl Identity for HardwareIdentity
source§fn sender(&self) -> Result<Principal, String>
fn sender(&self) -> Result<Principal, String>
Returns a sender, ie. the Principal ID that is used to sign a request. Read more
source§fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
Sign a request ID derived from a content map. Read more
source§fn sign_delegation(&self, content: &Delegation) -> Result<Signature, String>
fn sign_delegation(&self, content: &Delegation) -> Result<Signature, String>
source§fn sign_arbitrary(&self, content: &[u8]) -> Result<Signature, String>
fn sign_arbitrary(&self, content: &[u8]) -> Result<Signature, String>
Sign arbitrary bytes. Read more
source§fn delegation_chain(&self) -> Vec<SignedDelegation>
fn delegation_chain(&self) -> Vec<SignedDelegation>
A list of signed delegations connecting
sender
to public_key
, and in that order.Auto Trait Implementations§
impl Freeze for HardwareIdentity
impl RefUnwindSafe for HardwareIdentity
impl Send for HardwareIdentity
impl Sync for HardwareIdentity
impl Unpin for HardwareIdentity
impl UnwindSafe for HardwareIdentity
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