nitrocli
nitrocli is a program that provides a command line interface for certain commands on the Nitrokey Storage device.
The following commands are currently supported:
- status: Report status information about the Nitrokey.
- config: Access the Nitrokey's configuration
- get: Read the current configuration.
- set: Change the configuration.
- storage: Work with the Nitrokey's storage.
- open: Open the encrypted volume. The user PIN needs to be entered.
- close: Close the encrypted volume.
- status: Print information about the Nitrokey's storage.
- otp: Access one-time passwords (OTP).
- get: Generate a one-time password.
- set: Set an OTP slot.
- status: List all OTP slots.
- clear: Delete an OTP slot.
- pin: Manage the Nitrokey's PINs.
- clear: Remove the user and admin PIN from gpg-agent's cache.
- set: Change the admin or the user PIN.
- unblock: Unblock and reset the user PIN.
Usage
Usage is as simple as providing the name of the respective command as a parameter (note that some commands are organized through subcommands, which are required as well), e.g.:
# Open the nitrokey's encrypted volume.
# Close it again.
More examples, a more detailed explanation of the purpose, the potential
subcommands, as well as the parameters of each command are provided in
the man
page.
Installation
In addition to Rust itself and Cargo, its package management tool, the following dependencies are required:
- hidapi: In order to provide USB access this library is used.
- GnuPG: The
gpg-connect-agent
program allows the user to enter PINs.
Via Packages
Packages are available for:
- Arch Linux:
nitrocli
in the Arch User Repository - Gentoo Linux:
app-crypt/nitrocli
ebuild
From Crates.io
nitrocli is published on crates.io and can directly be installed from there:
From Source
After cloning the repository and changing into the nitrocli
subfolder,
the build is as simple as running:
It is recommended that the resulting executable be installed in a
directory accessible via the PATH
environment variable.
Contributing
Contributions are generally welcome. Please follow the guidelines outlined in CONTRIBUTING.md.
Acknowledgments
Robin Krahl (@robinkrahl) has been a crucial help for the development of nitrocli.
The Nitrokey UG has generously provided the necessary hardware for developing and testing the program.
License
nitrocli is made available under the terms of the GPLv3.
See the LICENSE file that accompanies this distribution for the full text of the license.