[][src]Struct nitrokey::OtpSlotData

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

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”.

Methods

impl OtpSlotData[src]

pub fn new<S: Into<String>, T: Into<String>>(
    number: u8,
    name: S,
    secret: T,
    mode: OtpMode
) -> OtpSlotData
[src]

Constructs a new instance of this struct.

pub fn use_enter(self) -> OtpSlotData[src]

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

pub fn token_id<S: Into<String>>(self, id: S) -> OtpSlotData[src]

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

Trait Implementations

impl Debug for OtpSlotData[src]

Auto Trait Implementations

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> From<T> for T[src]

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

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.