I'm working on a program in which I would like to generate an ECDSA key with OpenSSL's libcrypto EVP API. I found this piece of documentation that deals with this topic.
When specifying the key type, there is no EVP_PKEY_ECDSA
, only EVP_PKEY_EC
. The documentation says this is for ECDSA and ECDH keys.
However the parameter generation function EVP_PKEY_CTX_set_ec_paramgen_curve_nid
only takes a curve NID (name of the used elliptic curve in OpenSSL). There is no way to tell this function that I want an ECDSA key. According to this documentation, there is no other EVP_PKEY_CTX_set_ec_
function, either.
I'm not an expert in cryptography, so I may not understand correctly.
Is an EC
key the same as an ECDSA
or ECDH
key? The OpenSSL docs and terminology definitely suggest that, but do not say it explicitly. If they are not the same, how can I make sure to generate an ECDSA
key?