Struct yubikey_piv::mgm::MgmKey[][src]

pub struct MgmKey(_);

Management Key (MGM).

This key is used to authenticate to the management applet running on a YubiKey in order to perform administrative functions.

The only supported algorithm for MGM keys is 3DES.

Implementations

impl MgmKey[src]

pub fn generate() -> Result<Self, Error>[src]

Generate a random MGM key

pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, Error>[src]

Create an MGM key from byte slice.

Returns an error if the slice is the wrong size or the key is weak.

pub fn new(key_bytes: [u8; 24]) -> Result<Self, Error>[src]

Create an MGM key from the given byte array.

Returns an error if the key is weak.

pub fn get_derived(yubikey: &mut YubiKey, pin: &[u8]) -> Result<Self, Error>[src]

Get derived management key (MGM)

pub fn get_protected(yubikey: &mut YubiKey) -> Result<Self, Error>[src]

Get protected management key (MGM)

pub fn set_default(yubikey: &mut YubiKey) -> Result<(), Error>[src]

Resets the management key for the given YubiKey to the default value.

This will wipe any metadata related to derived and PIN-protected management keys.

pub fn set_manual(
    &self,
    yubikey: &mut YubiKey,
    require_touch: bool
) -> Result<(), Error>
[src]

Configures the given YubiKey to use this management key.

The management key must be stored by the user, and provided when performing key management operations.

This will wipe any metadata related to derived and PIN-protected management keys.

pub fn set_protected(&self, yubikey: &mut YubiKey) -> Result<(), Error>[src]

Configures the given YubiKey to use this as a PIN-protected management key.

This enables key management operations to be performed with access to the PIN.

Trait Implementations

impl AsRef<[u8; 24]> for MgmKey[src]

impl Clone for MgmKey[src]

impl Default for MgmKey[src]

impl Drop for MgmKey[src]

impl<'a> TryFrom<&'a [u8]> for MgmKey[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for MgmKey

impl Send for MgmKey

impl Sync for MgmKey

impl Unpin for MgmKey

impl UnwindSafe for MgmKey

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> Pipe for T where
    T: ?Sized

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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