Struct botan::HOTP [−][src]
pub struct HOTP { /* fields omitted */ }
Generate or check HOTP tokens
Methods
impl HOTP
[src]
impl HOTP
pub fn new(key: &[u8], hash_algo: &str, digits: usize) -> Result<HOTP>
[src]
pub fn new(key: &[u8], hash_algo: &str, digits: usize) -> Result<HOTP>
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]
pub fn generate(&self, counter: u64) -> Result<u32>
Generate an HOTP code
pub fn check(&self, code: u32, counter: u64) -> Result<bool>
[src]
pub fn check(&self, code: u32, counter: u64) -> Result<bool>
Check an HOTP code
pub fn check_with_resync(
&self,
code: u32,
counter: u64,
resync_range: usize
) -> Result<(bool, u64)>
[src]
pub fn check_with_resync(
&self,
code: u32,
counter: u64,
resync_range: usize
) -> Result<(bool, u64)>
Check an HOTP code, allowing counter resync
Trait Implementations
impl Debug for HOTP
[src]
impl Debug for HOTP
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 HOTP
[src]
impl Drop for HOTP