pub struct User<T: Device> { /* private fields */ }
Expand description
A Nitrokey device with user authentication.
To obtain an instance of this struct, use the [authenticate_user
][] method from the
Authenticate
trait. To get back to an unauthenticated device, use the device
method.
Implementations
Trait Implementations
sourceimpl<T: Device> GenerateOtp for User<T>
impl<T: Device> GenerateOtp for User<T>
sourcefn get_hotp_code(&self, slot: u8) -> Result<String, CommandError>
fn get_hotp_code(&self, slot: u8) -> Result<String, CommandError>
Generates an HOTP code on the given slot. This operation may require user authorization,
depending on the device configuration (see
get_config
). Read moresourcefn get_totp_code(&self, slot: u8) -> Result<String, CommandError>
fn get_totp_code(&self, slot: u8) -> Result<String, CommandError>
Generates a TOTP code on the given slot. This operation may require user authorization,
depending on the device configuration (see
get_config
). Read moresourcefn set_time(&self, time: u64) -> Result<(), CommandError>
fn set_time(&self, time: u64) -> Result<(), CommandError>
Sets the time on the Nitrokey. This command may set the time to arbitrary values.
time
is the number of seconds since January 1st, 1970 (Unix timestamp). Read moresourcefn get_hotp_slot_name(&self, slot: u8) -> Result<String, CommandError>
fn get_hotp_slot_name(&self, slot: u8) -> Result<String, CommandError>
Returns the name of the given HOTP slot. Read more
sourcefn get_totp_slot_name(&self, slot: u8) -> Result<String, CommandError>
fn get_totp_slot_name(&self, slot: u8) -> Result<String, CommandError>
Returns the name of the given TOTP slot. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for User<T>where
T: RefUnwindSafe,
impl<T> Send for User<T>where
T: Send,
impl<T> Sync for User<T>where
T: Sync,
impl<T> Unpin for User<T>where
T: Unpin,
impl<T> UnwindSafe for User<T>where
T: UnwindSafe,
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