Struct yubihsm::auth_key::AuthKey [−][src]
pub struct AuthKey(_);
YubiHSM2
authentication keys (2 * AES-128 symmetric PSK) from which
session keys are derived.c
Methods
impl AuthKey
[src]
impl AuthKey
pub fn random() -> Self
[src]
pub fn random() -> Self
Generate a random AuthKey
using OsRng
.
pub fn derive_from_password(password: &[u8]) -> Self
[src]
pub fn derive_from_password(password: &[u8]) -> Self
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.
pub fn from_slice(key_slice: &[u8]) -> Result<Self, AuthKeyError>
[src]
pub fn from_slice(key_slice: &[u8]) -> Result<Self, AuthKeyError>
Create an AuthKey from a 32-byte slice, returning an error if the key is the wrong length
pub fn new(key_bytes: [u8; 32]) -> Self
[src]
pub fn new(key_bytes: [u8; 32]) -> Self
Create a new AuthKey from the given byte array
pub fn as_secret_slice(&self) -> &[u8]
[src]
pub fn as_secret_slice(&self) -> &[u8]
Borrow the secret authentication keys
Trait Implementations
impl Clone for AuthKey
[src]
impl Clone for AuthKey
fn clone(&self) -> AuthKey
[src]
fn clone(&self) -> AuthKey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for AuthKey
[src]
impl Debug for AuthKey
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for AuthKey
[src]
impl Default for AuthKey
Derive the default authentication key for all YubiHSM2s
impl Drop for AuthKey
[src]
impl Drop for AuthKey
impl From<[u8; 32]> for AuthKey
[src]
impl From<[u8; 32]> for AuthKey
impl Serialize for AuthKey
[src]
impl Serialize for AuthKey
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
[src]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for AuthKey
[src]
impl<'de> Deserialize<'de> for AuthKey
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<AuthKey, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<AuthKey, D::Error>
Deserialize this value from the given Serde deserializer. Read more