Enum PasswordSource

Source
pub enum PasswordSource {
    Inline,
    InlineWithConfirmation,
    ExternalOnDemand,
    ExternalSideEffect,
}
Expand description

How the password is obtained.

Variants§

§

Inline

The application must provide the password to unlock the key.

This means that if a key is locked, then before executing a private key operation, the key must be unlocked using KeyHandle::unlock.

§

InlineWithConfirmation

The application must provide the password to unlock the key, but operations must be confirmed externally.

This means that if a key is locked, then before executing a private key operation, the key must be unlocked using KeyHandle::unlock. These operations may require the user externally confirm the operation.

§

ExternalOnDemand

The user must provide the password out of band.

The user provides the password using an external pinpad, or via a trusted user interface so as to not reveal the password to the application or system.

This means if the key is locked, the user will be prompted to unlock it as a side effect of a private key operation.

The application can use KeyHandle::unlock to proactively cause the user to be prompted to unlock the key.

§

ExternalSideEffect

The user must provide the password out of band as a side effect of an operation.

The user provides the password using an external pinpad, or via a trusted user interface so as to not reveal the password to the application or system.

This means if the key is locked, the user will be prompted to unlock it as a side effect of a private key operation.

The application cannot proactively cause the user to be prompted to unlock the key; the prompt is only a side effect of a private key operation. That is, the key cannot be unlocked using KeyHandle::unlock.

Implementations§

Source§

impl PasswordSource

Source

pub fn is_inline(&self) -> bool

Returns whether the password needs to be provided inline.

Returns whether this is PasswordSource::Inline or PasswordSource::InlineWithConfirmation.

Source

pub fn is_external_source(&self) -> bool

Returns whether the password will be provided externally.

Returns whether this is PasswordSource::ExternalSideEffect or PasswordSource::ExternalOnDemand.

Trait Implementations§

Source§

impl Debug for PasswordSource

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