Topic: [SOLVED] Ecc private key to DER format

Hello,

Is there a function in yassl to convert an ecc private key (either from ecc_key struct or a private key in raw format) to a DER format? (something similar to the RsaKeyToDer() but for ecc key)

Thank you.

Share

Re: [SOLVED] Ecc private key to DER format

Hello Amir
Let me know if this is what you are looking for http://www.yassl.com/forums/topic518-co … o-der.html
If not could you tell us some more about the project and the use case?
Thanks,
Jacob

Share

Re: [SOLVED] Ecc private key to DER format

Hello Jacob,

Thanks for your answer.
From my understanding, the ecc_export_x963() function just exports the ecc Public key in ANSI X9.63 format. Is this correct?

What I need is the ecc private key in DER format (which includes the private key, public key, EC parameters and version information) so I can use it with the wolfSSL_CTX_use_PrivateKey_buffer() function to load it to the ssl layer, together with a public key certificate.

Thank you,
Amir

Share

Re: [SOLVED] Ecc private key to DER format

Hi Amir,
Sorry, yeah looks like that function only exports to ANSI X9.63 format.
I did some farther resarch into possible ways for wolfSSL to convert an ECC key to DER format. We currently don't have a function or process that can convert ECC keys to DER format to then be used in wolfSSL_CTX_use_PrivateKey_buffer(). Thanks for bringing it to our attention though, it's now been added to the feature list for looking into adding a future ECC to DER function.

Regards,
Jacob

Share

Re: [SOLVED] Ecc private key to DER format

Hi Amir,

We just added a function to wolfSSL embedded SSL which converts an ecc_key to DER format:

int EccKeyToDer(ecc_key* key, byte* output, word32 inLen)

You can grab our latest code from GitHub, here: https://github.com/cyassl/cyassl

This change was added with the following commit:

https://github.com/cyassl/cyassl/commit … f524f0bf94

Best Regards,
Chris

Re: [SOLVED] Ecc private key to DER format

I appreciate your support!

Amir

Share

Re: [SOLVED] Ecc private key to DER format

I have three keys in raw format. private key(32 bytes), qx(32 bytes) and qy(32 bytes).
Can I create related ecc_key from these three key and sign message using these ecc_key?
of course i can sign msg if proper ecc_key has been made from above three raw keys.

From other side(openssl), i want to verify sign of the message using qx and qy only.
Is this possible with wolfSSL?

Share