Esempio n. 1
0
        public static void V_Test_RSA_MakeUserKeys()
        {
            Console.WriteLine("Testing RSA_MakeUserKeys ...");
            int    nRet            = 0;
            string sPublicKeyFile  = null;
            string sPrivateKeyFile = null;
            string sPassword       = null;

            sPublicKeyFile  = "myuser.pub";
            sPrivateKeyFile = "myuser.epk";
            sPassword       = "******";

            // Create a new pair of RSA keys saved as BER-encoded files
            Console.WriteLine("About to create a new RSA key pair...");

            nRet = Rsa.MakeKeys(sPublicKeyFile, sPrivateKeyFile, 512, Rsa.PublicExponent.Exp_EQ_3, 1000, sPassword, Rsa.PbeOptions.PbeWithSHAAnd_KeyTripleDES_CBC, false);

            Console.WriteLine("RSA_MakeUserKeys returns " + nRet + " (expected 0)");
        }