summaryrefslogtreecommitdiff
path: root/src/otp.rs
Commit message (Collapse)AuthorAge
* Move set_time from Device to GenerateOtpRobin Krahl2018-05-28
| | | | | | The set_time operation is only used with TOTP generation. Therefore it makes more sense to have it in the GenerateOtp trait than in the Device trait.
* Rewrap documentation comments to 100 charactersRobin Krahl2018-05-28
|
* Move the authenticate methods to a new Authenticate traitRobin Krahl2018-05-22
|
* Add an example for setting the current timeRobin Krahl2018-05-22
| | | | | The example uses the chrono crate and can therefore not be executed, but at least it shows how to set the Nitrokey device to the current time.
* Improve OtpSlotData constructor / builderRobin Krahl2018-05-22
| | | | | Firstly, use Into<String> instead of String::from(&str). Secondly, add methods to set the two arguments not set in the constructor.
* Restructure code by functionalityRobin Krahl2018-05-22
In future versions, we want to support not only the Nitrokey Pro, but also the Nitrokey Storage. This requires a better code layout. This patch introduces two main changes: First, the OTP-specific methods are moved from the Device trait and the AdminAuthenticatedDevice struct to the functionality-based traits ConfigureOtp and GenerateOtp. This will hopefully make it easier to integrate the Nitrokey Storage. Secondly, the code is split into separate modules. These modules are currently all private and re-exported in the lib module, but we can consider making them public in the future.