Struct botan::TOTP [−][src]
pub struct TOTP { /* fields omitted */ }
Generate or check TOTP tokens
Methods
impl TOTP
[src]
impl TOTP
pub fn new(
key: &[u8],
hash_algo: &str,
digits: usize,
time_step: usize
) -> Result<TOTP>
[src]
pub fn new(
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]
pub fn generate(&self, timestamp: u64) -> Result<u32>
Generate an TOTP code
pub fn check(
&self,
code: u32,
timestamp: u64,
allowed_drift: usize
) -> Result<bool>
[src]
pub fn check(
&self,
code: u32,
timestamp: u64,
allowed_drift: usize
) -> Result<bool>
Check an TOTP code
Trait Implementations
impl Debug for TOTP
[src]
impl Debug for TOTP
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Drop for TOTP
[src]
impl Drop for TOTP