keycard-go/cmd/keycard/README.md

81 lines
1.6 KiB
Markdown
Raw Normal View History

2019-03-01 17:48:40 +00:00
# keycard
2018-11-09 10:13:36 +00:00
2019-03-01 17:48:40 +00:00
`keycard` is a command line tool you can use to initialize a smartcard with the [Status Keycard](https://github.com/status-im/status-keycard).
2018-11-09 10:13:36 +00:00
2018-11-28 12:46:42 +00:00
## Dependencies
2019-03-01 17:48:40 +00:00
To install `keycard-go` you need `go` in your system.
2018-11-28 12:46:42 +00:00
MacOSX:
`brew install go`
2018-11-09 10:13:36 +00:00
## Installation
2019-03-07 09:04:31 +00:00
`go get -u github.com/status-im/keycard-go/cmd/keycard`
2018-11-09 10:13:36 +00:00
2018-11-28 12:46:42 +00:00
The executable will be installed in `$GOPATH/bin`.
Check your `$GOPATH` with `go env`.
2018-11-09 10:13:36 +00:00
## Usage
2019-03-01 17:48:40 +00:00
### Install the keycard applet
2018-11-09 10:13:36 +00:00
2018-11-09 10:16:20 +00:00
The install command will install an applet to the card.
2019-03-01 17:48:40 +00:00
You can download the status `cap` file from the [status-im/status-keycard releases page](https://github.com/status-im/status-keycard/releases).
2018-11-09 10:16:20 +00:00
2018-11-09 10:13:36 +00:00
```bash
2019-03-01 17:48:40 +00:00
keycard install -l debug -a PATH_TO_CAP_FILE
2018-11-09 10:13:36 +00:00
```
In case the applet is already installed and you want to force a new installation you can pass the `-f` flag.
### Card info
```bash
2019-03-01 17:48:40 +00:00
keycard info -l debug
2018-11-09 10:13:36 +00:00
```
The `info` command will print something like this:
```
Installed: true
Initialized: false
InstanceUID: 0x
PublicKey: 0x112233...
Version: 0x
AvailableSlots: 0x
2018-11-09 10:17:18 +00:00
KeyUID: 0x
2018-11-09 10:13:36 +00:00
```
### Card initialization
```bash
2019-03-01 17:48:40 +00:00
keycard init -l debug
2018-11-09 10:13:36 +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
```
2018-11-28 12:46:42 +00:00
### Deleting the applet from the card
2018-11-28 12:48:09 +00:00
:warning: **WARNING! This command will remove the applet and all the keys from the card.** :warning:
2018-11-28 12:46:42 +00:00
```bash
2019-03-01 17:48:40 +00:00
keycard delete -l debug
2018-11-28 12:46:42 +00:00
```
2018-11-09 10:13:36 +00:00
### Pairing
```bash
2019-03-01 17:48:40 +00:00
keycard pair -l debug
2018-11-09 10:13:36 +00:00
```
The process will ask for `PairingPassword` and `PIN` and will generate a pairing key you can use to interact with the card.