Hi,
I'm having trouble setting up the RSA public key. First I generated an RSA keypair as in the example ex_sss_rsa.c. Then I got the RSA public key and stored it in a buffer. Now, I want to set the RSA public key in a new ID using sss_key_object_init, sss_key_object_allocate_handle, sss_key_store_set_key and the parameters kSSS_KeyPart_Public, kSSS_CipherType_RSA_CRT. In set_key function, I pass the buffer that I used previously to store the public key in DER format. So far, I've checked that the key is correctly parsed into the public exponent and public modulus. However, the SE052 responds with 0x6A80 (wrong data). Could you help me with this problem?
Thank you.
Hi @ar01 ,
For RSA CRT format, the key components must match the size of the key type, e.g. for RSA2048, each component must be 2048 bit (256 bytes). The ex_rsa uses RSA2048, but not sure how you create a new key ID, was the key length the same? is it possible to share your code for a review?
Have a great day,
Kan
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------