aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/args.rs
Commit message (Collapse)AuthorAge
...
* Implement the otp set subcommandRobin Krahl2018-12-24
| | | | | | | | | | This patch implements the `otp set` subcommand that configures an OTP slot. There are two ways to specify an OTP secret: as a hexadecimal string (that means that every two characters are interpreted as a hexadecimal representation of one byte of the secret) or as an ASCII string (that means that the ASCII code of every character is interpreted as one byte of the secret). As the HOTP RFC mentions both representations, this implementation supports both.
* Implement the otp get subcommandRobin Krahl2018-12-24
| | | | | | | This patch implements the `otp get` subcommand that allows the user to generate a one-time password on the Nitrokey device. Before generating the password, the device configuration is checked so that the user only has to enter a PIN if it is required for the OTP generation.
* Implement otp commandRobin Krahl2018-12-24
| | | | | This patch adds the `otp` top-level command. Its subcommands provide access to one-time passwords on the Nitrokey.
* Clear both user and admin PINRobin Krahl2018-12-24
| | | | | | Currently, we only clear the user PIN if clear is called. This patch changes the clear command to also clear the admin PIN as we will start to use the admin PIN in upcoming patches.
* Port argument handling to argparseRobin Krahl2018-12-23
This patch replaces the macro for argument parsing with `argparse::ArgumentParser` from the argparse crate. It moves the application logic to the `commands` module and the argument parsing to the `options` module. An enum is used to represent the available commands. The code is based on the `subcommands.rs` example shipped with argparse.