开发者

How do I use X509Certificate2 for mutual SSL in .NET? Private key is not recognized

So, I have a private key, and a certificate in 2 files... I need to feed that to X509Certificate2 to use for mutual SSL. When I simply do new X509Certificate2 - I can specify one file name. I created .pem file with both, but cert.HasPrivateKey shows FALSE.

Wha开发者_开发技巧t would be the format in which both will be in one file, and X509Certificate2 would understand?


A p12/pkcs12/pfx file has both private key and certificate

An example of using this is:

X509Certificate2 cert = X509Certificate2(@"C:\Path\my.pfx", "password");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜