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
sourceimpl OtpSlotData
impl OtpSlotData
sourcepub fn new<S: Into<String>, T: Into<String>>(
number: u8,
name: S,
secret: T,
mode: OtpMode
) -> OtpSlotData
pub fn new<S: Into<String>, T: Into<String>>(
number: u8,
name: S,
secret: T,
mode: OtpMode
) -> OtpSlotData
Constructs a new instance of this struct.
sourcepub fn use_enter(self) -> OtpSlotData
pub fn use_enter(self) -> OtpSlotData
Enables pressing the enter key after sending an OTP code using double-pressed numlock, capslock or scrollock.
sourcepub fn token_id<S: Into<String>>(self, id: S) -> OtpSlotData
pub fn token_id<S: Into<String>>(self, id: S) -> OtpSlotData
Sets the token ID, see OATH Token Identifier Specification, section “Class A”.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for OtpSlotData
impl Send for OtpSlotData
impl Sync for OtpSlotData
impl Unpin for OtpSlotData
impl UnwindSafe for OtpSlotData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more