hsmtool::spxef

Struct 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 Freeze for SpxEf

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V