|
Botan
2.13.0
Crypto and TLS for C++11
|
#include <hotp.h>
Public Member Functions | |
| uint32_t | generate_hotp (uint64_t counter) |
| HOTP (const SymmetricKey &key, const std::string &hash_algo="SHA-1", size_t digits=6) | |
| HOTP (const uint8_t key[], size_t key_len, const std::string &hash_algo="SHA-1", size_t digits=6) | |
| std::pair< bool, uint64_t > | verify_hotp (uint32_t otp, uint64_t starting_counter, size_t resync_range=0) |
|
inline |
| key | the secret key shared between client and server |
| hash_algo | the hash algorithm to use, should be SHA-1 or SHA-256 |
| digits | the number of digits in the OTP (must be 6, 7, or 8) |
Definition at line 26 of file hotp.h.
| Botan::HOTP::HOTP | ( | const uint8_t | key[], |
| size_t | key_len, | ||
| const std::string & | hash_algo = "SHA-1", |
||
| size_t | digits = 6 |
||
| ) |
| key | the secret key shared between client and server |
| key_len | length of key param |
| hash_algo | the hash algorithm to use, should be SHA-1 or SHA-256 |
| digits | the number of digits in the OTP (must be 6, 7, or 8) |
Definition at line 14 of file hotp.cpp.
References BOTAN_ARG_CHECK, and Botan::MessageAuthenticationCode::create_or_throw().
| uint32_t Botan::HOTP::generate_hotp | ( | uint64_t | counter | ) |
Generate the HOTP for a particular counter value
Definition at line 42 of file hotp.cpp.
References Botan::load_be< uint32_t >().
Referenced by botan_hotp_generate(), Botan::TOTP::generate_totp(), verify_hotp(), and Botan::TOTP::verify_totp().
| std::pair< bool, uint64_t > Botan::HOTP::verify_hotp | ( | uint32_t | otp, |
| uint64_t | starting_counter, | ||
| size_t | resync_range = 0 |
||
| ) |
Check an OTP value using a starting counter and a resync range
| otp | the client provided OTP |
| starting_counter | the server's guess as to the current counter state |
| resync_range | if 0 then only HOTP(starting_counter) is accepted If larger than 0, up to resync_range values after HOTP are also checked. |
Definition at line 52 of file hotp.cpp.
References generate_hotp().
Referenced by botan_hotp_check().
1.8.9.1