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:
parent
1b8ac82754
commit
8fe910f298
|
@ -57,6 +57,8 @@ func create_private_key(cmd *Command, args []string) {
|
||||||
pk, err = pki.NewPrivateKeyEcdsa(FlagPrivateKeyGeneration.Curve)
|
pk, err = pki.NewPrivateKeyEcdsa(FlagPrivateKeyGeneration.Curve)
|
||||||
case "rsa":
|
case "rsa":
|
||||||
pk, err = pki.NewPrivateKeyRsa(FlagPrivateKeyGeneration.Size)
|
pk, err = pki.NewPrivateKeyRsa(FlagPrivateKeyGeneration.Size)
|
||||||
|
case "ed25519":
|
||||||
|
pk, err = pki.NewPrivateKeyEd25519()
|
||||||
default:
|
default:
|
||||||
crash_with_help(cmd, ErrorInput, "Unknown private key type '%s'", FlagPrivateKeyGeneration.Type)
|
crash_with_help(cmd, ErrorInput, "Unknown private key type '%s'", FlagPrivateKeyGeneration.Type)
|
||||||
}
|
}
|
||||||
|
@ -108,6 +110,7 @@ func checkPrivateKeyGeneration() error {
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("Length of %d is not allowed for rsa!", size)
|
return fmt.Errorf("Length of %d is not allowed for rsa!", size)
|
||||||
}
|
}
|
||||||
|
case "ed25519":
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Type %s is unknown!", pk_type)
|
return fmt.Errorf("Type %s is unknown!", pk_type)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue