Struct botan::HOTP [−][src]
Generate or check HOTP tokens
Implementations
impl HOTP
[src]
pub fn new(key: &[u8], hash_algo: &str, digits: usize) -> Result<HOTP>
[src]
Instantiate a new HOTP instance with the given parameters
Examples
let hotp = botan::HOTP::new(&[1,2,3,4], "SHA-1", 6);
pub fn generate(&self, counter: u64) -> Result<u32>
[src]
Generate an HOTP code
pub fn check(&self, code: u32, counter: u64) -> Result<bool>
[src]
Check an HOTP code
pub fn check_with_resync(
&self,
code: u32,
counter: u64,
resync_range: usize
) -> Result<(bool, u64)>
[src]
&self,
code: u32,
counter: u64,
resync_range: usize
) -> Result<(bool, u64)>
Check an HOTP code, allowing counter resync
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for HOTP
impl !Send for HOTP
impl !Sync for HOTP
impl Unpin for HOTP
impl UnwindSafe for HOTP
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,