Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 219
Megi Ben Nun Avatar asked Nov 15 '25 19:11

Megi Ben Nun


1 Answers

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.

like image 93
Dmitriy Konovalov Avatar answered Nov 17 '25 08:11

Dmitriy Konovalov