0
0
Fork 0

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.
This commit is contained in:
Gibheer 2015-07-19 17:34:25 +02:00
parent 1b8ac82754
commit 8fe910f298
1 changed files with 3 additions and 0 deletions

View File

@ -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)
}