.NET 5 and 6 lets us import RSA public keys in PEM format by using RSA.ImportFromPem. Somewhat surprisingly, there’s no corresponding ExportToPem method that would let us export RSA keys in PEM format. But with some extension methods and a little help from CryptoAPI, we can fill that gap. .NET Core 3.0 and later Although .NET Core 3.0 and newer versions don’t provide a RSA.ExportToPem method, they do provide 2 other useful methods: RSA.ExportRSAPublicKey, which exports a public key as a D...