Problem with X509 certificate parameters

M

Marco Moioli

Hi everybody:

I want to import the private key of my 1st certificate contained in my
Certification store.
I create the certificate with the private key exportable, but if I run the
code below, I obtain "Export of private parameters is not supported"

static void Main(string[] args)

{

X509CertificateStore store = X509CertificateStore.CurrentUserStore(
X509CertificateStore.MyStore );

store.OpenRead();

X509Certificate first_cert = (X509Certificate)store.Certificates[0];

RSAParameters first_cert_key = first_cert.Key.ExportParameters(true);


RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

rsa.ImportParameters(first_cert_key);

}

Thanks in advance,

Marco
 
S

Sreedhar Alluri

Marco

Could you kindly update me when you kind a solution. I get the same error!

Shall post the solution should I find one.

Sreedhar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top