make -o alias of --key
This commit is contained in:
parent
7e6fd174ef
commit
2e3ead4102
|
@ -84,12 +84,25 @@ func main() {
|
||||||
|
|
||||||
func gen(args []string) {
|
func gen(args []string) {
|
||||||
var keyname string
|
var keyname string
|
||||||
|
var keynameAlt string
|
||||||
|
//var keynameAlt2 string
|
||||||
var pubname string
|
var pubname string
|
||||||
flags := flag.NewFlagSet("gen", flag.ExitOnError)
|
flags := flag.NewFlagSet("gen", flag.ExitOnError)
|
||||||
flags.StringVar(&keyname, "o", "", "private key file (ex: key.jwk.json or key.pem)")
|
flags.StringVar(&keynameAlt, "o", "", "output file (alias of --key)")
|
||||||
|
//flags.StringVar(&keynameAlt2, "priv", "", "private key file (alias of --key)")
|
||||||
|
flags.StringVar(&keyname, "key", "", "private key file (ex: key.jwk.json or key.pem)")
|
||||||
flags.StringVar(&pubname, "pub", "", "public key file (ex: pub.jwk.json or pub.pem)")
|
flags.StringVar(&pubname, "pub", "", "public key file (ex: pub.jwk.json or pub.pem)")
|
||||||
flags.Parse(args)
|
flags.Parse(args)
|
||||||
|
|
||||||
|
if 0 == len(keyname) {
|
||||||
|
keyname = keynameAlt
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if 0 == len(keyname) {
|
||||||
|
keyname = keynameAlt2
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
key := keypairs.NewDefaultPrivateKey()
|
key := keypairs.NewDefaultPrivateKey()
|
||||||
marshalPriv(key, keyname)
|
marshalPriv(key, keyname)
|
||||||
pub := keypairs.NewPublicKey(key.Public())
|
pub := keypairs.NewPublicKey(key.Public())
|
||||||
|
|
Loading…
Reference in New Issue