|
Botan
2.13.0
Crypto and TLS for C++11
|
#include <totp.h>
Public Member Functions | |
| uint32_t | generate_totp (std::chrono::system_clock::time_point time_point) |
| uint32_t | generate_totp (uint64_t unix_time) |
| TOTP (const SymmetricKey &key, const std::string &hash_algo="SHA-1", size_t digits=6, size_t time_step=30) | |
| TOTP (const uint8_t key[], size_t key_len, const std::string &hash_algo="SHA-1", size_t digits=6, size_t time_step=30) | |
| bool | verify_totp (uint32_t otp, std::chrono::system_clock::time_point time, size_t clock_drift_accepted=0) |
| bool | verify_totp (uint32_t otp, uint64_t unix_time, size_t clock_drift_accepted=0) |
|
inline |
| key | the secret key shared between client and server |
| hash_algo | the hash algorithm to use, should be SHA-1, SHA-256 or SHA-512 |
| digits | the number of digits in the OTP (must be 6, 7, or 8) |
| time_step | granularity of OTP in seconds |
Definition at line 27 of file totp.h.
| Botan::TOTP::TOTP | ( | const uint8_t | key[], |
| size_t | key_len, | ||
| const std::string & | hash_algo = "SHA-1", |
||
| size_t | digits = 6, |
||
| size_t | time_step = 30 |
||
| ) |
| key | the secret key shared between client and server |
| key_len | length of key |
| hash_algo | the hash algorithm to use, should be SHA-1, SHA-256 or SHA-512 |
| digits | the number of digits in the OTP (must be 6, 7, or 8) |
| time_step | granularity of OTP in seconds |
Definition at line 13 of file totp.cpp.
References BOTAN_ARG_CHECK.
| uint32_t Botan::TOTP::generate_totp | ( | std::chrono::system_clock::time_point | time_point | ) |
Convert the provided time_point to a Unix timestamp and call generate_totp
Definition at line 27 of file totp.cpp.
Referenced by botan_totp_generate().
| uint32_t Botan::TOTP::generate_totp | ( | uint64_t | unix_time | ) |
Generate the OTP corresponding the the provided "Unix timestamp" (ie number of seconds since midnight Jan 1, 1970)
Definition at line 34 of file totp.cpp.
References Botan::HOTP::generate_hotp().
| bool Botan::TOTP::verify_totp | ( | uint32_t | otp, |
| std::chrono::system_clock::time_point | time, | ||
| size_t | clock_drift_accepted = 0 |
||
| ) |
Definition at line 39 of file totp.cpp.
Referenced by botan_totp_check().
| bool Botan::TOTP::verify_totp | ( | uint32_t | otp, |
| uint64_t | unix_time, | ||
| size_t | clock_drift_accepted = 0 |
||
| ) |
1.8.9.1