How to generate ECDSA private and public key for DNSSEC using OpenSSL?
问题 I am trying to create private and public keys for DNSSEC algorithm 13: #include <stdio.h> #include <stdlib.h> #include <openssl/ec.h> #include <openssl/obj_mac.h> #include <openssl/bn.h> int main() { EC_KEY *eckey = NULL; const EC_POINT *pub_key = NULL; const EC_GROUP *group = NULL; const BIGNUM *res; BN_CTX *ctx; ctx = BN_CTX_new(); eckey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); EC_KEY_generate_key(eckey); res = EC_KEY_get0_private_key(eckey); printf("Private: %s\n", BN_bn2hex(res))