[gnutls-help] Generating EC key with GnuTLS
Aki Tuomi
cmouse at cmouse.fi
Wed May 11 11:52:52 CEST 2016
I am trying to use GnuTLS library to generate EC key with following code:
int ec;
gnutls_privkey_t priv;
const char *curve = "secp521r1";
gnutls_pk_algorithm_t pk_algo;
gnutls_ecc_curve_t pk_curve;
int bits;
pk_curve = gnutls_ecc_curve_get_id(curve);
bits = GNUTLS_CURVE_TO_BITS(curve);
pk_algo = GNUTLS_PK_EC;
if ((ec = gnutls_privkey_init(&priv)) != GNUTLS_E_SUCCESS)
return print_error(ec);
ec = gnutls_privkey_generate(priv, pk_algo, bits, 0);
if (ec != GNUTLS_E_SUCCESS) {
gnutls_privkey_deinit(priv);
return print_error(ec);
}
This gives me
ERROR: The curve is unsupported
on gnutls_privkey_generate. I am completely at loss why this happens?
libgnutls-dev: 3.4.10-4ubuntu1
Regards,
Aki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: </pipermail/attachments/20160511/d02d7e71/attachment.sig>
More information about the Gnutls-help
mailing list