noritama / gen-keypair

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gen-keypair

Automatically generates RSA key-pair.

Download

install

$ go get github.com/noritama/gen-keypair

Use

$ 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-----
`
}

Options

$ 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

//go:generate gen-keypair -pkgname gen -out ./gen/keypair_gen.go

go1.4

build

$ make # => ./gen-keypair

About

License:MIT License


Languages

Language:Go 94.8%Language:Makefile 5.2%