I've recently started my first project in C#, and it's a big one. I'm creating a Minecraft server by reading the protocol and doing it all myself. I've come a long way, but now I need to generate an RSA key pair so I can encrypt and decrypt data on the socket.
I've created a new RSACryptoServiceProvider
using new RSACryptoServiceProvider(2048)
, but when I go to export using ToXmlString()
, it gives the following PlatformNotSupportedException
error:
Is there any alternatives to read the public key of the RSA I just generated? I am using .NET Core 2.2 if that helps. Thanks!