aboutsummaryrefslogtreecommitdiff
path: root/private_key.go
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2015-07-19 17:34:25 +0200
committerGibheer <gibheer@gmail.com>2015-07-19 17:35:24 +0200
commit8fe910f298c6ab24632053ccd578fc484a9b929f (patch)
tree48c7681e383766abfd896151e83607d4629e704e /private_key.go
parent1b8ac827542f23e85a0eb399369a33fc206c72e7 (diff)
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.
Diffstat (limited to 'private_key.go')
-rw-r--r--private_key.go3
1 files changed, 3 insertions, 0 deletions
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)
}