cancel
Showing results for 
Search instead for 
Did you mean: 

ECDSAsign

Wei Zhang
Associate II
Posted on March 22, 2018 at 12:44

Hi all,

I am currently on a project which leverage the x-cube-cryptolib to send messages cross the network securely. To be specific, I want to use the ECDSA part to sign and verify my messages.  

After some exploration and experiments, I can run through the ECC example. However,  the example used a generated private/public keys (by the lib) which are structured well in memory. I wanted to use my personal private key for sign and my personal public key for verify. 

So here are the questions - 

    1. How can I covert a private key (in pem or hex format)  to an ECCprivKey_stt structre?  

    2. How can I convert a public key (in pem or hex format) to  a  ECpoint_stt  structure? 

    3. How can I convert a signature in hex format  to a  ECDSAsignature_stt structure? 

Any suggestions on these?  are there any apis that cover these parts ?   If I want to implement them, s

hould I deal with the little/big endian issues if the private/public keys come from my MacBook? 

Thank you so much!

1 REPLY 1
Wei Zhang
Associate II
Posted on March 26, 2018 at 04:51

I figured it out by experimenting with openssl.  Apparently we don't need to handle the big/small endian in user code. Given a private key, it worked to sign a message from STM32 with the specified key, send the signature to network and verify it from a laptop.