diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-12-04 16:29:56 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2018-02-28 19:23:04 +0100 |
commit | 2faa8f6782a2e6294ed8849048a281d12d60da1c (patch) | |
tree | 0e8947f40697da905278c44338f948ce5fa2b3c7 /include/NitrokeyManager.h | |
parent | d5486ba77235a874245fbee07a75cea89fa59ea2 (diff) | |
download | libnitrokey-2faa8f6782a2e6294ed8849048a281d12d60da1c.tar.gz libnitrokey-2faa8f6782a2e6294ed8849048a281d12d60da1c.tar.bz2 |
Initial support for multiple devices with C++ and test
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/NitrokeyManager.h')
-rw-r--r-- | include/NitrokeyManager.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/NitrokeyManager.h b/include/NitrokeyManager.h index 0db0856..2a79922 100644 --- a/include/NitrokeyManager.h +++ b/include/NitrokeyManager.h @@ -30,6 +30,7 @@ #include "stick20_commands.h" #include <vector> #include <memory> +#include <unordered_map> namespace nitrokey { using namespace nitrokey::device; @@ -67,6 +68,8 @@ char * strndup(const char* str, size_t maxlen); 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); + std::vector<std::string> list_devices(); + bool connect_with_path (std::string path); bool connect(const char *device_model); bool connect(); bool disconnect(); @@ -198,8 +201,10 @@ char * strndup(const char* str, size_t maxlen); static shared_ptr <NitrokeyManager> _instance; std::shared_ptr<Device> device; + std::unordered_map<std::string, shared_ptr<Device> > connected_devices; - stick10::ReadSlot::ResponsePayload get_OTP_slot_data(const uint8_t slot_number); + + stick10::ReadSlot::ResponsePayload get_OTP_slot_data(const uint8_t slot_number); bool is_valid_hotp_slot_number(uint8_t slot_number) const; bool is_valid_totp_slot_number(uint8_t slot_number) const; bool is_valid_password_safe_slot_number(uint8_t slot_number) const; |