diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-07-26 20:53:19 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-01 13:54:57 +0200 |
commit | f6bd34b262b66fde862aa3d95c339f5c587156eb (patch) | |
tree | 23b9ff9b03a06679d767d4a7706ac71f0a9be201 /NitrokeyManager.cc | |
parent | c34196ea22e61c31fa83c22a3b73c19ba04a30bf (diff) | |
download | libnitrokey-f6bd34b262b66fde862aa3d95c339f5c587156eb.tar.gz libnitrokey-f6bd34b262b66fde862aa3d95c339f5c587156eb.tar.bz2 |
Handle writing PW safe slot
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index d453f7b..7ffee51 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -263,4 +263,18 @@ namespace nitrokey{ return strdup((const char *) response.slot_password); } + void NitrokeyManager::write_password_safe_slot(uint8_t slot_number, const char *slot_name, const char *slot_login, + const char *slot_password) { + auto p = get_payload<SetPasswordSafeSlotData>(); + p.slot_number = slot_number; + strcpyT(p.slot_name, slot_name); + strcpyT(p.slot_password, slot_password); + SetPasswordSafeSlotData::CommandTransaction::run(*device, p); + + auto p2 = get_payload<SetPasswordSafeSlotData2>(); + p2.slot_number = slot_number; + strcpyT(p2.slot_login_name, slot_login); + SetPasswordSafeSlotData2::CommandTransaction::run(*device, p2); + } + }
\ No newline at end of file |