Struct yubihsm::authentication::key::Key
source · pub struct Key(_);
Expand description
YubiHSM 2
authentication keys (2 * AES-128 symmetric PSK) from which
session keys are derived.c
Implementations§
source§impl Key
impl Key
sourcepub fn derive_from_password(password: &[u8]) -> Self
Available on crate feature passwords
only.
pub fn derive_from_password(password: &[u8]) -> Self
passwords
only.Derive an auth key from a password (using PBKDF2 + static salt). This method is designed to be compatible with yubihsm-shell. Ensure you use a long, random password when using this method as the key derivation algorithm used does little to prevent brute force attacks.
sourcepub fn from_slice(key_slice: &[u8]) -> Result<Self, Error>
pub fn from_slice(key_slice: &[u8]) -> Result<Self, Error>
Create an authentication::Key
from a 32-byte slice, returning an
error if the key is the wrong length
sourcepub fn as_secret_slice(&self) -> &[u8] ⓘ
pub fn as_secret_slice(&self) -> &[u8] ⓘ
Borrow the secret authentication keys
Trait Implementations§
source§impl Default for Key
Available on crate feature passwords
only.
impl Default for Key
Available on crate feature
passwords
only.Derive the default authentication key for all YubiHSM 2s
source§impl<'de> Deserialize<'de> for Key
impl<'de> Deserialize<'de> for Key
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Key, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Key, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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