My steps are:
Create X509Certificate2
with public key:
X509Certificate2 clientCertificate = new X509Certificate2("public key certificate blob as byte[]");
How do I want to load the private key blob to clientCertificate
?
It looks like you can not import RSA private key with just .net framework tools.
Check out this thread How to read a PEM RSA private key from .NET.
Doesn't work... I guess the key is not RSACryptoServiceProvider. I need a general solution for this issue. My issue is - I am working with WLAN configuration, when my user configure wireless profile, he gives me public key in one file, and private key in another.
BTW - The certificate is RSA certificate. but when i am executing the next line - csp.ImportCspBlob(privateKeyBlob); , i am getting an exception... :(
Can you post it? And what file format is used as private key container?
I can't post the private key :(.
Oh, no! I mean exception text! You wrote: "but when i am executing the next line - csp.ImportCspBlob(privateKeyBlob); , i am getting an exception... :(". Can you post Exception details?