Struct botan::TOTP [−][src]
Generate or check TOTP tokens
Implementations
impl TOTP
[src]
pub fn new(
key: &[u8],
hash_algo: &str,
digits: usize,
time_step: usize
) -> Result<TOTP>
[src]
key: &[u8],
hash_algo: &str,
digits: usize,
time_step: usize
) -> Result<TOTP>
Instantiate a new TOTP instance with the given parameters
Examples
let totp = botan::TOTP::new(&[1,2,3,4], "SHA-1", 6, 30);
pub fn generate(&self, timestamp: u64) -> Result<u32>
[src]
Generate an TOTP code
pub fn check(
&self,
code: u32,
timestamp: u64,
allowed_drift: usize
) -> Result<bool>
[src]
&self,
code: u32,
timestamp: u64,
allowed_drift: usize
) -> Result<bool>
Check an TOTP code
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TOTP
impl !Send for TOTP
impl !Sync for TOTP
impl Unpin for TOTP
impl UnwindSafe for TOTP
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>,