pub struct YubikeyHotpChallenge { /* private fields */ }Expand description
NDNCERT challenge that verifies a YubiKey HOTP code.
The CA is pre-seeded with the same HMAC-SHA1 seed that was programmed into
the YubiKey via ykpersonalize. At verification time the CA checks codes
in a lookahead window and advances the counter to stay synchronised.
Implementations§
Source§impl YubikeyHotpChallenge
impl YubikeyHotpChallenge
Sourcepub fn new(seed: Vec<u8>, initial_counter: u64) -> Self
pub fn new(seed: Vec<u8>, initial_counter: u64) -> Self
Create a new challenge handler.
seed: the same secret programmed into the YubiKey withykpersonalize -2 -a <hex-seed>initial_counter: must match the YubiKey’s counter state (default 0 for freshly provisioned)
Sourcepub fn with_window(self, window: u64) -> Self
pub fn with_window(self, window: u64) -> Self
Set the lookahead window (default 20).
Sourcepub fn with_max_tries(self, max_tries: u8) -> Self
pub fn with_max_tries(self, max_tries: u8) -> Self
Set maximum submission attempts (default 3).
Trait Implementations§
Source§impl ChallengeHandler for YubikeyHotpChallenge
impl ChallengeHandler for YubikeyHotpChallenge
Source§fn challenge_type(&self) -> &'static str
fn challenge_type(&self) -> &'static str
The challenge type identifier (e.g.
"possession", "token", "pin", "email").Auto Trait Implementations§
impl Freeze for YubikeyHotpChallenge
impl RefUnwindSafe for YubikeyHotpChallenge
impl Send for YubikeyHotpChallenge
impl Sync for YubikeyHotpChallenge
impl Unpin for YubikeyHotpChallenge
impl UnwindSafe for YubikeyHotpChallenge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more