Automatically generates RSA key-pair.
- Release page: https://github.com/noritama/gen-keypair/releases
- Download binary file(version 0.0.3): https://github.com/noritama/gen-keypair/releases/download/v0.0.3/gen-keypair
$ go get github.com/noritama/gen-keypair
$ gen-keypair -out /tmp/hoge_gen.go -pkgname main
Output generate file: /tmp/hoge_gen.go
pacakge name: main
$ cat /tmp/hoge_gen.go
package main
func GetPrivateKey() (string) {
return `-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
`
}
func GetPublicKey() (string) {
return `-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
`
}
$ gen-keypair -h
Usage of gen-keypair:
gen-keypair [OPTIONS] ARGS...
Options -out="/Users/noritama/repository/github/gen-keypair/keypair_gen.go": output file path
-pkgname="main": package name
//go:generate gen-keypair -pkgname gen -out ./gen/keypair_gen.go
go1.4
$ make # => ./gen-keypair