From f6bd34b262b66fde862aa3d95c339f5c587156eb Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 26 Jul 2016 20:53:19 +0200 Subject: Handle writing PW safe slot Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'NitrokeyManager.cc') 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(); + 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(); + p2.slot_number = slot_number; + strcpyT(p2.slot_login_name, slot_login); + SetPasswordSafeSlotData2::CommandTransaction::run(*device, p2); + } + } \ No newline at end of file -- cgit v1.2.1