diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 19:56:45 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-06-19 19:56:45 +0200 |
commit | e1ef8d79809190c5ac5d540bd4aa376dcfda7e93 (patch) | |
tree | 37e00db5876dc1965f0b59a5c6b007fd51f5b603 /libnitrokey/NitrokeyManager.h | |
parent | b46dbfa63f344cd7e5323139cf71cd100a179682 (diff) | |
parent | 9a4e5a3e0161ea2d0d72d371439ee44b8b137489 (diff) | |
download | libnitrokey-e1ef8d79809190c5ac5d540bd4aa376dcfda7e93.tar.gz libnitrokey-e1ef8d79809190c5ac5d540bd4aa376dcfda7e93.tar.bz2 |
Merge branch 'pr_114'
Cleanup API related to device's TOTP time management
Fixes #114
Diffstat (limited to 'libnitrokey/NitrokeyManager.h')
-rw-r--r-- | libnitrokey/NitrokeyManager.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libnitrokey/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h index d4630b0..0689c3f 100644 --- a/libnitrokey/NitrokeyManager.h +++ b/libnitrokey/NitrokeyManager.h @@ -65,6 +65,18 @@ char * strndup(const char* str, size_t maxlen); stick10::ReadSlot::ResponsePayload get_HOTP_slot_data(const uint8_t slot_number); bool set_time(uint64_t time); + /** + * Set the device time used for TOTP to the given time. Contrary to + * {@code set_time(uint64_t)}, this command fails if {@code old_time} + * > {@code time} or if {@code old_time} is zero (where {@code + * old_time} is the current time on the device). + * + * @param time new device time as Unix timestamp (seconds since + * 1970-01-01) + */ + void set_time_soft(uint64_t time); + + [[deprecated("get_time is deprecated -- use set_time_soft instead")]] bool get_time(uint64_t time = 0); bool erase_totp_slot(uint8_t slot_number, const char *temporary_password); bool erase_hotp_slot(uint8_t slot_number, const char *temporary_password); |