Key type is now case insensitive

This commit is contained in:
Wigy 2016-12-13 15:07:39 +01:00
parent 51861455e8
commit d5853103ff
No known key found for this signature in database
GPG Key ID: AFF11C67C4E13357

View File

@ -7,6 +7,7 @@ import (
ci "github.com/libp2p/go-libp2p-crypto" ci "github.com/libp2p/go-libp2p-crypto"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
"strings"
) )
func main() { func main() {
@ -16,10 +17,10 @@ func main() {
flag.Parse() flag.Parse()
var atyp int var atyp int
switch *typ { switch strings.ToLower(*typ) {
case "RSA": case "rsa":
atyp = ci.RSA atyp = ci.RSA
case "Ed25519": case "ed25519":
atyp = ci.Ed25519 atyp = ci.Ed25519
default: default:
fmt.Fprintln(os.Stderr, "unrecognized key type: ", *typ) fmt.Fprintln(os.Stderr, "unrecognized key type: ", *typ)