You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be possible. You should check the tomcrypt API reference, TLSe is just using the tomcrypt crypto funcitons.
Just keep in mind that the private key when using ECDHE (Elliptic Curve Diffie-Hellman Ephemeral) is useless, because the common secret is derived as: remote_public_key (+) local_private_key == local_public_key (+) remote_private_key.
Knowing keysize, you could just save key->k to an unsigned char *buf of keysize (you should check if its in bits or bytes). That should be enough. You also need the curve parameters, but this is set in the named curve definition. In other others, you should add an id for the curve in order to identify it.
Check mp_unsigned_bin_size(a) and mp_to_unsigned_bin(a, buffer) where a is key->k and buffer is your saved buffer. Then you can use mp_read_unsigned_bin to read it back from the buffer.
How can i export private key/public key from
context->ecc_dhe->k and make a new ecc_key variable.
I can create an ecc_key by using ecc_ansi_x963_import_ex() from
a buffer. Is it possible to do the similar for the private key ?.
The text was updated successfully, but these errors were encountered: