コード例 #1
0
        private void CreateKey_Click(object sender, EventArgs e)
        {
            var key = RSACrypto.CreateKey();

            textBox_PublicKey.Text  = key.PublicKey;
            textBox_PrivateKey.Text = key.PrivateKey;
        }
コード例 #2
0
        /// <summary>
        /// 初始化用户
        /// </summary>
        /// <param name="Name"></param>
        public User(String Name)
        {
            this.Name = Name;
            var key = RSACrypto.CreateKey();

            PrivateKey = key.PrivateKey;
            PublicKey  = key.PublicKey;
            Sender     = new Sender(this, PrivateKey);
            Receiver   = new Receiver(this, PrivateKey);
        }