Struct hsmtool::spxef::SpxEf

source ·
pub struct SpxEf { /* private fields */ }
Expand description

SpxEf implements host-based SPHINCS+ signing with elementary files stored on a PKCS#11 token.

This is not as secure as signing on an HSM, but allows secure storage of the key material on a token. Every effort is made to destroy secret key material loaded to host RAM after use to prevent unintentional leaking of keys.

Implementations§

source§

impl SpxEf

source

pub fn new(session: Rc<Session>) -> Box<Self>

Trait Implementations§

source§

impl SpxInterface for SpxEf

source§

fn get_version(&self) -> Result<String>

Get the version of the backend.

source§

fn list_keys(&self) -> Result<Vec<KeyEntry>>

List keys known to the backend.

source§

fn get_key_info(&self, alias: &str) -> Result<KeyInfo>

Get the public key info.

source§

fn generate_key( &self, alias: &str, algorithm: &str, _token: &str, flags: GenerateFlags ) -> Result<KeyEntry>

Generate a key pair.

source§

fn import_keypair( &self, alias: &str, algorithm: &str, _token: &str, overwrite: bool, public_key: &[u8], private_key: &[u8] ) -> Result<KeyEntry>

Import a key pair.

source§

fn sign( &self, alias: Option<&str>, key_hash: Option<&str>, message: &[u8] ) -> Result<Vec<u8>>

Sign a message.

source§

fn verify( &self, alias: Option<&str>, key_hash: Option<&str>, message: &[u8], signature: &[u8] ) -> Result<bool>

Verify a message.

Auto Trait Implementations§

§

impl !RefUnwindSafe for SpxEf

§

impl !Send for SpxEf

§

impl !Sync for SpxEf

§

impl Unpin for SpxEf

§

impl !UnwindSafe for SpxEf

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V