2019-03-18 20:20:09 +00:00
|
|
|
# keycard-cli
|
2019-03-01 17:44:07 +00:00
|
|
|
|
2019-04-09 14:09:31 +00:00
|
|
|
`keycard` is a command line tool to manage [Status Keycards](https://github.com/status-im/status-keycard).
|
2019-03-01 17:44:07 +00:00
|
|
|
|
2019-03-18 20:55:45 +00:00
|
|
|
* [Dependencies](#dependencies)
|
2019-03-18 20:56:41 +00:00
|
|
|
* [Installation](#installation)
|
2019-03-27 13:24:39 +00:00
|
|
|
* [Continuous Integration](#continuous-integration)
|
2019-03-19 22:34:29 +00:00
|
|
|
* CLI Commands
|
|
|
|
* [Card info](#card-info)
|
|
|
|
* [Keycard applet installation](#keycard-applet-installation)
|
|
|
|
* [Card initialization](#card-initialization)
|
|
|
|
* [Deleting the applet](#deleting-the-applet)
|
|
|
|
* [Keycard shell](#keycard-shell)
|
2019-03-18 20:55:45 +00:00
|
|
|
|
2019-03-01 17:44:07 +00:00
|
|
|
## Dependencies
|
|
|
|
|
2019-04-09 14:09:31 +00:00
|
|
|
On linux you need to install and run the [pcsc daemon](https://linux.die.net/man/8/pcscd).
|
2019-03-01 17:44:07 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2019-04-09 14:09:31 +00:00
|
|
|
Download the binary for your platform from the [releases page](https://github.com/status-im/keycard-cli/releases).
|
2019-03-01 17:44:07 +00:00
|
|
|
|
2019-03-27 13:24:39 +00:00
|
|
|
## Continuous Integration
|
|
|
|
|
|
|
|
Jenkins builds provide:
|
|
|
|
|
|
|
|
* [PR Builds](https://ci.status.im/job/status-keycard/job/prs/job/keycard-cli/) - Run only the `test` and `build` targets.
|
|
|
|
* [Manual Builds](https://ci.status.im/job/status-keycard/job/keycard-cli/) - Create GitHub release draft with binaries for 3 platforms.
|
|
|
|
|
|
|
|
Successful PR builds are mandatory.
|
|
|
|
|
2019-03-01 17:44:07 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Card info
|
|
|
|
|
|
|
|
```bash
|
2019-04-09 14:09:31 +00:00
|
|
|
keycard info -l debug
|
2019-03-01 17:44:07 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The `info` command will print something like this:
|
|
|
|
|
|
|
|
```
|
|
|
|
Installed: true
|
|
|
|
Initialized: false
|
|
|
|
InstanceUID: 0x
|
|
|
|
PublicKey: 0x112233...
|
|
|
|
Version: 0x
|
|
|
|
AvailableSlots: 0x
|
|
|
|
KeyUID: 0x
|
|
|
|
```
|
2019-03-18 20:55:45 +00:00
|
|
|
### Keycard applet installation
|
|
|
|
|
|
|
|
The `install` command will install an applet to the card.
|
|
|
|
You can download the status `cap` file from the [status-im/status-keycard releases page](https://github.com/status-im/status-keycard/releases).
|
|
|
|
|
|
|
|
```bash
|
2019-04-09 14:09:31 +00:00
|
|
|
keycard install -l debug -a PATH_TO_CAP_FILE
|
2019-03-18 20:55:45 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
In case the applet is already installed and you want to force a new installation you can pass the `-f` flag.
|
|
|
|
|
2019-03-01 17:44:07 +00:00
|
|
|
|
|
|
|
### Card initialization
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
2019-04-09 14:09:31 +00:00
|
|
|
keycard init -l debug
|
2019-03-01 17:44:07 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
The `init` command initializes the card and generates the secrets needed to pair the card to a device.
|
|
|
|
|
|
|
|
```
|
|
|
|
PIN 123456
|
|
|
|
PUK 123456789012
|
|
|
|
Pairing password: RandomPairingPassword
|
|
|
|
```
|
|
|
|
|
2019-03-18 20:55:45 +00:00
|
|
|
### Deleting the applet
|
2019-03-01 17:44:07 +00:00
|
|
|
|
|
|
|
:warning: **WARNING! This command will remove the applet and all the keys from the card.** :warning:
|
|
|
|
|
|
|
|
```bash
|
2019-03-21 14:05:52 +00:00
|
|
|
keycard-cli delete -l debug
|
2019-03-01 17:44:07 +00:00
|
|
|
```
|
2019-03-18 20:55:45 +00:00
|
|
|
|
|
|
|
### Keycard shell
|
|
|
|
TODO
|