From 8fe910f298c6ab24632053ccd578fc484a9b929f Mon Sep 17 00:00:00 2001 From: Gibheer Date: Sun, 19 Jul 2015 17:34:25 +0200 Subject: [PATCH] add ed25519 support This adds support for ed25519 keys for the following options * create-private * create-public * sign-input * verify-input The format of the private key is purely PEM format and may change. But as I did not find any documentation on that topic yet, I will keep it as it is for the moment. --- private_key.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/private_key.go b/private_key.go index 42dba68..aa28e78 100644 --- a/private_key.go +++ b/private_key.go @@ -57,6 +57,8 @@ func create_private_key(cmd *Command, args []string) { pk, err = pki.NewPrivateKeyEcdsa(FlagPrivateKeyGeneration.Curve) case "rsa": pk, err = pki.NewPrivateKeyRsa(FlagPrivateKeyGeneration.Size) + case "ed25519": + pk, err = pki.NewPrivateKeyEd25519() default: crash_with_help(cmd, ErrorInput, "Unknown private key type '%s'", FlagPrivateKeyGeneration.Type) } @@ -108,6 +110,7 @@ func checkPrivateKeyGeneration() error { } else { return fmt.Errorf("Length of %d is not allowed for rsa!", size) } + case "ed25519": default: return fmt.Errorf("Type %s is unknown!", pk_type) }