Export private/public keys from X509 certificate to PEM
Update (2021-01-12): For .NET 5 this is pretty easy. .NET Core 3.0 can even get most of the way there. The original answer was written when .NET Core 1.1 was the newest version of .NET Core. It explains what these new methods are doing under the covers. .NET 5+: byte[] certificateBytes = cert.RawData; char[] certificatePem … Read more