CatalinJuganaru-3997 avatar image
0 Votes"
CatalinJuganaru-3997 asked CatalinJuganaru-3997 edited

Import RSA private key from pem file


I need help. I'm trying to implement TLS1.3 on my server and I'm stuck importing a 2048-bit RSA private key. I want to import it from a .pem file. I manage to read it, then convert it from base64 to hex (binary) and I have it all in a string.

I use NCryptImportKey and I managed to import the key, in the sense that it doesn't give me an error, then I sign a hash (for the whole handshake), also without error. But when I test with openssl s_client ... it returns an error "bad signature".

Please give me an idea, something to help me. I'm 99% sure that I generated the hash correctly, so it only remains if the key is imported successfully, or the settings for the signing algorithm are ok.

Thank you very much.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You are trying to implement TLS 1.3, but the Command Prompt displays "TLS 1.2". Is this expected?

2 Votes 2 ·

Could you post the code instead of images? Could you please provide your system version?

0 Votes 0 ·

It's been a few days, do you have any progress?

0 Votes 0 ·

0 Answers