Struct nitrokey::OtpSlotData

source ·
pub struct OtpSlotData {
    pub number: u8,
    pub name: String,
    pub secret: String,
    pub mode: OtpMode,
    pub use_enter: bool,
    pub token_id: Option<String>,
}
Expand description

The configuration for an OTP slot.

Fields

number: u8

The number of the slot – must be less than three for HOTP and less than 15 for TOTP.

name: String

The name of the slot – must not be empty.

secret: String

The secret for the slot.

mode: OtpMode

The OTP generation mode.

use_enter: bool

If true, press the enter key after sending an OTP code using double-pressed numlock, capslock or scrolllock.

token_id: Option<String>

Set the token ID, see OATH Token Identifier Specification, section “Class A”.

Implementations

Constructs a new instance of this struct.

Enables pressing the enter key after sending an OTP code using double-pressed numlock, capslock or scrollock.

Sets the token ID, see OATH Token Identifier Specification, section “Class A”.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.