Exporting a Certificate as BASE-64 encoded .cer

前端 未结 4 704
青春惊慌失措
青春惊慌失措 2020-12-08 19:13

I am trying to export a cert without the private key as as BASE-64 encoded file, same as exporting it from windows. When exported from windows I am able to open the .cer fil

4条回答
  •  抹茶落季
    2020-12-08 19:25

    try this:

    X509Certificate2 cerifikata = new X509Certificate2("C://certificate.pfx");
    File.WriteAllBytes("D://Test.cer",cerifikata.Export(X509ContentType.Cert));
    

提交回复
热议问题