Warm tip: This article is reproduced from serverfault.com, please click

How can I add a private key to X509Certificate2 after I have already added the public key?

发布于 2011-12-08 07:07:11

My steps are:

  1. Create X509Certificate2 with public key:

    X509Certificate2 clientCertificate = new X509Certificate2("public key certificate blob as byte[]");
    
  2. How do I want to load the private key blob to clientCertificate?

Questioner
Megi Ben Nun
Viewed
0
2017-05-23 20:31:27

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.