Enum Protection

Source
pub enum Protection {
    Unlocked,
    UnknownProtection(Option<String>),
    Password(Option<String>),
    ExternalPassword(Option<String>),
    ExternalTouch(Option<String>),
    ExternalOther(Option<String>),
}
Expand description

How secret key material is protected.

Variants§

§

Unlocked

The secret key material is unlocked.

§

UnknownProtection(Option<String>)

The key store is not able to determine if the secret key material is protected.

It is, however, safe to try a secret key operation (e.g., the retry counter will not be decremented). Trying an operation may trigger an external event, like a system pin entry dialog.

§

Password(Option<String>)

The secret key material is protected by a password. It can be unlocked using the unlock interface.

The string is an optional hint for the user.

§

ExternalPassword(Option<String>)

The secret key material is protected, and can only be unlocked using an external terminal.

The string is an optional hint for the user.

Note: some devices don’t provide a mechanism to determine if the secret key material is currently locked. For instance, some smart cards can be configured to require the user to enter a pin on an external keypad before their first use, but not require it as long as the smart card remains attached to the host, and also not provide a mechanism for the host to determine the current policy. Such devices should still report Protection::ExternalPassword, and should phrase the hint appropriately.

§

ExternalTouch(Option<String>)

The secret key material is protected, and can only be unlocked if the user touches the device.

The string is an optional hint for the user.

§

ExternalOther(Option<String>)

The secret key material is protected, and can only be unlocked externally.

The string is an optional hint for the user, e.g., “Please connect to the VPN.”

Trait Implementations§

Source§

impl Debug for Protection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T