A program to generate ipfs private keys, creating Kubernetes manifests.
Go to file
Whyrusleeping a083da5efd
Merge pull request #12 from en0ma/add-support-to-read-keys
add support for reading keys
2022-06-29 09:21:35 -07:00
go.mod add support for reading keys 2022-06-04 13:07:00 +01:00
go.sum add support for reading keys 2022-06-04 13:07:00 +01:00
LICENSE license 2016-03-22 16:39:37 -07:00
main.go add support for reading raw keys and support new key types 2022-06-04 13:50:09 +01:00
README.md add support for reading raw keys and support new key types 2022-06-04 13:50:09 +01:00

ipfs-key

standard-readme compliant

A tool for easily generating and reading ipfs keypairs

Table of Contents

Installation

$ go get github.com/whyrusleeping/ipfs-key

Usage

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 option. The key type can be changed by specifying the -type option (RSA, Ed25519, Secp256k1 or ECDSA).

$ ipfs-key -bitsize=4096 > my-rsa4096.key
Generating a 4096 bit RSA key...
Success!
ID for generated key: QmS5cwbxmGyPiEH3SYNgiAazG46NvogKxfx2iX6jt4ef1a
$ ipfs-key -type=ed25519 > my-ed.key
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!
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

Contribute

PRs accepted.

License

MIT Copyright (c) 2016 Jeromy Johnson