privatekey to X509Certificate2

2/9/2012 11:11:13 AM
Gravatar
Total Posts 2

private key to X509Certificate2

Hi,

I used this procedure http://wiki.ncryptoki.com/How-to-extract-an-X509Certificate.ashx to extract   a certificate and create X509Certificate2 object. My X509Certificate2 object does not have a private key, cert.HasPrivateKey is false. Is there a way to extract certificate with private key?

 

Andrzej

2/9/2012 11:24:06 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: privatekey to X509Certificate2

You cannot extract a private key from a certificate because a certificate contains the public key only. It doesn't contain a private key.

If you want to extract the private key related that certificate read this:

http://wiki.ncryptoki.com/How-to-extract-a-private-key.ashx

2/9/2012 11:30:36 AM
Gravatar
Total Posts 2

Re: privatekey to X509Certificate2

Thank you,

I know that it is beyond Ncryptoki topic but maybe you know how to add exported private key to X509Certificate2 object in C#. I'm trying to sign xml document and stuck a bit.

 

Andrzej