Convert Certificate and Private Key to .PFX programmatically in C#

前端 未结 1 612
北海茫月
北海茫月 2021-01-11 09:45

I have a .cer file output from a successful LetsEncrypt certificate request.

I have the original Private Key used to create the Certificate Signing Request (CSR) for

相关标签:
1条回答
  • 2021-01-11 10:25

    CryptoGuy's answer was really helpful and pointed us in the right direction.

    We were still struggling to import a Binary DER file but this code fixed that:

    var oc = OpenSSL.X509.X509Certificate.FromDER(bio); 
    

    These pages were useful:

    https://github.com/openssl-net/openssl-net/blob/master/ManagedOpenSsl/X509/X509Certificate.cs

    https://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2.rawdata

    Thanks all for your help :)

    0 讨论(0)
提交回复
热议问题