Botan 3.5.0
Crypto and TLS for C&
|
#include <botan/ffi.h>
#include <botan/internal/ffi_util.h>
Go to the source code of this file.
Functions | |
int | botan_totp_check (botan_totp_t totp, uint32_t totp_code, uint64_t timestamp, size_t acceptable_clock_drift) |
int | botan_totp_destroy (botan_totp_t totp) |
int | botan_totp_generate (botan_totp_t totp, uint32_t *totp_code, uint64_t timestamp) |
int | botan_totp_init (botan_totp_t *totp, const uint8_t key[], size_t key_len, const char *hash_algo, size_t digits, size_t time_step) |
int botan_totp_check | ( | botan_totp_t | totp, |
uint32_t | totp_code, | ||
uint64_t | timestamp, | ||
size_t | acceptable_clock_drift ) |
Verify a TOTP code
totp | the TOTP object |
totp_code | the presented OTP |
timestamp | the current local timestamp |
acceptable_clock_drift | specifies the acceptable amount of clock drift (in terms of time steps) between the two hosts. |
Definition at line 69 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_INVALID_VERIFIER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_totp_destroy | ( | botan_totp_t | totp | ) |
Destroy a TOTP instance
Definition at line 46 of file ffi_totp.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
int botan_totp_generate | ( | botan_totp_t | totp, |
uint32_t * | totp_code, | ||
uint64_t | timestamp ) |
Generate a TOTP code for the provided timestamp
totp | the TOTP object |
totp_code | the OTP code will be written here |
timestamp | the current local timestamp |
Definition at line 55 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
int botan_totp_init | ( | botan_totp_t * | totp, |
const uint8_t | key[], | ||
size_t | key_len, | ||
const char * | hash_algo, | ||
size_t | digits, | ||
size_t | time_step ) |
Initialize a TOTP instance
Definition at line 25 of file ffi_totp.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and Botan_FFI::ffi_guard_thunk().