nitrocli 0.1.0

A command line tool for interacting with the Nitrokey Storage device.
nitrocli-0.1.0 is not a library.

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:

  • open: Open the encrypted volume. The user PIN needs to be entered.
  • close: Close the encrypted volume.
  • status: Report status information about the Nitrokey.
  • clear: Remove the user PIN from gpg-agent's cache.

Usage

Usage is as simple as providing the name of the respective command as a parameter, e.g.:

# Open the nitrokey's encrypted volume.
$ nitrocli open

$ nitrocli status
Status:
  SD card ID:        0xdeadbeef
  firmware version:  44.0
  firmware:          unlocked
  storage keys:      created
  user retry count:  3
  admin retry count: 3
  volumes:
    unencrypted:     active
    encrypted:       active
    hidden:          inactive

# Close it again.
$ nitrocli close

Installation

In order to compile the program the hid crate needs to be available which allows to access the nitrokey as a USB HID device. This crate and its dependencies are contained in the form of subrepos in compatible and tested versions. Cargo is required to build the program.

The build is as simple as running:

$ cargo build --release

It is recommended that the resulting executable be installed in a directory accessible via the PATH environment variable.

If you are using Gentoo Linux, there is an ebuild available that can be used directly.