Skip to content

Instantly share code, notes, and snippets.

@NMillard
Last active August 4, 2022 09:17
Show Gist options
  • Select an option

  • Save NMillard/419d855c757694dd450cb878b6f5b731 to your computer and use it in GitHub Desktop.

Select an option

Save NMillard/419d855c757694dd450cb878b6f5b731 to your computer and use it in GitHub Desktop.
Create RSA key paris
class Program {
static void Main(string[] args) {
using RSA rsa = RSA.Create();
Console.WriteLine($"-----Private key-----{Environment.NewLine}{Convert.ToBase64String(rsa.ExportRSAPrivateKey())}{Environment.NewLine}");
Console.WriteLine($"-----Public key-----{Environment.NewLine}{Convert.ToBase64String(rsa.ExportRSAPublicKey())}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment