예제 #1
0
        public void GenerateKeysTest()
        {
            var keySet = kit.GenerateKeys();

            Assert.IsTrue(kit.E > 10000);
            Assert.IsTrue(kit.P > 10000);
            Assert.IsTrue(kit.Q > 10000);
        }
예제 #2
0
        /// <summary>
        /// 預設公鑰及私鑰的位置
        /// </summary>
        private void SetDefaultKey()
        {
            this.textBoxEncryptKeyPath.Text = "RSA.Pub";
            this.textBoxDecryptKeyPath.Text = "RSA.Private";

            if (!File.Exists("RSA.Pub") || !File.Exists("RSA.Private"))
            {
                RSAKit.GenerateKeys();
            }
        }