From 7197f19f38b06fe2953cfba1fe755d4562f5786e Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 29 May 2018 20:49:40 +0000 Subject: Add support for password safes A password safe (PWS) stores names, logins and passwords in slots. PWS are supported both by the Nitrokey Pro and the Nitrokey Storage. They are implemented as a struct wrapping a device as the device may not be disconnected while the password safe is alive. The creation of a password safe is handled by the GetPasswordSafe trait, implemented by DeviceWrapper, Pro and Storage. --- src/device.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/device.rs') diff --git a/src/device.rs b/src/device.rs index 1201540..7d69df8 100644 --- a/src/device.rs +++ b/src/device.rs @@ -3,6 +3,7 @@ use libc; use nitrokey_sys; use std::ffi::CString; use otp::GenerateOtp; +use pws::GetPasswordSafe; use util::{get_last_error, result_from_string, CommandError, CommandStatus}; /// Available Nitrokey models. @@ -147,7 +148,7 @@ pub struct Storage {} /// /// This trait provides the commands that can be executed without authentication and that are /// present on all supported Nitrokey devices. -pub trait Device: GenerateOtp { +pub trait Device: GetPasswordSafe + GenerateOtp { /// Returns the serial number of the Nitrokey device. The serial number is the string /// representation of a hex number. /// -- cgit v1.2.1