RSAPrivateKey and RSAPublicKey read content

6/28/2019 10:37:30 AM
Gravatar
Total Posts 2

RSAPrivateKey and RSAPublicKey read content

I am getting RSAPrivateKey and RSAPublicKey in the application which is generated through HSM device my doubt is that key is the actual key which is stored in my HSM card? if is same I need to use the private key for SFTP server authentication so that I need SSH type of key could you please provide a code for this. Currently, I am using the trial version of NCryptoki if it is possible I need to purchase this. Could you please help me?

7/3/2019 10:50:06 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: RSAPrivateKey and RSAPublicKey read content

Hi,

the RSAPrivateKey and RSAPublicKey that you get from NCryptoki are handles to the actual keys on the HSM.

You can read the public key data extracting it from the HSM by following this code: http://wiki.ncryptoki.com/How-to-extract-an-RSA-public-key.ashx

You can read the private key data, only if it is set as "Exportable", by using the code here: http://wiki.ncryptoki.com/How-to-extract-a-private-key.ashx