2016-01-22 12:22:54 +00:00
|
|
|
# ipfs-key
|
2016-12-20 11:52:00 +00:00
|
|
|
|
|
|
|
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
|
|
|
|
|
2022-06-04 12:07:00 +00:00
|
|
|
> A tool for easily generating and reading ipfs keypairs
|
2016-12-20 11:52:00 +00:00
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
- [Installation](#installation)
|
|
|
|
- [Usage](#usage)
|
|
|
|
- [Contribute](#contribute)
|
|
|
|
- [License](#license)
|
2016-01-22 12:22:54 +00:00
|
|
|
|
|
|
|
## Installation
|
2016-12-20 11:52:00 +00:00
|
|
|
|
2016-01-22 12:22:54 +00:00
|
|
|
```
|
|
|
|
$ go get github.com/whyrusleeping/ipfs-key
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
2016-12-20 11:52:00 +00:00
|
|
|
|
|
|
|
When run, it will write the bytes of
|
|
|
|
the serialized private key to stdout. By default, a 2048 bit RSA key will be
|
|
|
|
generated. In this case the key size can be changed by specifying the `-bitsize`
|
2022-06-04 12:50:09 +00:00
|
|
|
option. The key type can be changed by specifying the `-type` option (RSA, Ed25519, Secp256k1 or ECDSA).
|
2016-12-20 11:52:00 +00:00
|
|
|
|
2016-01-22 12:22:54 +00:00
|
|
|
```
|
2016-12-20 11:52:00 +00:00
|
|
|
$ ipfs-key -bitsize=4096 > my-rsa4096.key
|
2022-06-04 12:07:00 +00:00
|
|
|
Generating a 4096 bit RSA key...
|
|
|
|
Success!
|
|
|
|
ID for generated key: QmS5cwbxmGyPiEH3SYNgiAazG46NvogKxfx2iX6jt4ef1a
|
|
|
|
```
|
|
|
|
```
|
2016-12-20 11:52:00 +00:00
|
|
|
$ ipfs-key -type=ed25519 > my-ed.key
|
2022-06-04 12:07:00 +00:00
|
|
|
Generating a 2048 bit ed25519 key...
|
|
|
|
Success!
|
|
|
|
ID for generated key: 12D3KooWHM4kLNwS2FzN5GtG5Dfy9h7dLTRs3rtuF9NiR4mjBv3h
|
|
|
|
```
|
|
|
|
```
|
|
|
|
$ ipfs-key -key my-ed.key
|
|
|
|
Reading key at: my-ed.key
|
|
|
|
Success!
|
2022-06-04 12:50:09 +00:00
|
|
|
ID for ed25519 key: 12D3KooWF1TKgiqLMh14za7dWMN5RFRC1WAvgHYioksmdwuhZkzT
|
|
|
|
```
|
|
|
|
For backward compatibility, to read RSA and Ed25519 keys generated with raw(), specify the `-type rsa` or `-type ed25519` before the `-key`
|
|
|
|
```
|
|
|
|
$ ipfs-key --type rsa -key my-ed.key
|
|
|
|
Reading key at: my-ed.key
|
|
|
|
Success!
|
|
|
|
ID for rsa key: 12D3KooWF1TKgiqLMh14za7dWMN5RFRC1WAvgHYioksmdwuhZkzT
|
2016-01-22 12:22:54 +00:00
|
|
|
```
|
2016-12-20 11:52:00 +00:00
|
|
|
|
|
|
|
## Contribute
|
|
|
|
|
|
|
|
PRs accepted.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2016-12-20 19:41:10 +00:00
|
|
|
[MIT](LICENSE) Copyright (c) 2016 [Jeromy Johnson](http://github.com/whyrusleeping)
|