INNER CODE UNIT · C#

Program

stulzq/RSAExtensions · sample/RSAExtensions.ConsoleApp/Program.cs:7

    class Program
    {
        static void Main(string[] args)
        {
            var rsa = RSA.Create(512);
            Console.WriteLine();
            Console.WriteLine(rsa.ExportPublicKey(RSAKeyType.Pkcs8));
            Console.WriteLine();
            Console.WriteLine(rsa.ExportPrivateKey(RSAKeyType.Pkcs1));
            Console.WriteLine("-----------------------------------------");
            Console.WriteLine(rsa.ExportPrivateKey(RSAKeyType.Pkcs1, true));
            Console.WriteLine("-----------------------------------------");
            Console.WriteLine(rsa.ExportPrivateKey(RSAKeyType.Pkcs8));
            Console.WriteLine("-----------------------------------------");
            Console.WriteLine(rsa.ExportPrivateKey(RSAKeyType.Pkcs8,true));

            Console.WriteLine("-----------------------------------------");
            Console.WriteLine(rsa.ExportPrivateKey(RSAKeyType.Xml));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…