aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/README.md
blob: 4e41c80f6fee0e058f6d88b1233e3f53127f42a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
nitrocli
========

**nitrocli** is a program that provides a command line interface for
certain commands on the [Nitrokey Storage][nitrokey] 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.:
```bash
# Open the nitrokey's encrypted volume.
$ nitrocli open

$ nitrocli status
Status:
  SD card ID:        0xdeadbeef
  firmware version:  0.44
  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
------------

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.

#### From Source
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:
```bash
$ cargo build --release
```

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

#### From Crates.io
**nitrocli** is [published][nitrocli-cratesio] on crates.io. If an
installation from the checked-out source code is not desired, a
quick-and-dirty local installation can happen via:
```bash
$ cargo install nitrocli --root=$PWD/nitrocli
```

#### Via Packages
If you are using [Gentoo Linux](https://www.gentoo.org/), there is an
[ebuild](https://github.com/d-e-s-o/nitrocli-ebuild) available that can
be used directly.

[nitrokey]: https://www.nitrokey.com/news/2016/nitrokey-storage-available
[nitrocli-cratesio]: https://crates.io/crates/nitrocli