Key type is now case insensitive
This commit is contained in:
parent
51861455e8
commit
d5853103ff
7
main.go
7
main.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user