コード例 #1
0
        private void btnNewPriKey_Click(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = "正在创建私钥...";
            string rText = Enc.genPrivateKey(int.Parse(txtKeyLength.Text));

            tabControl1.SelectedIndex = 0;
            if (rText.Length == 0 && Enc.isErrorInfo())
            {
                toolStripStatusLabel1.Text = "创建私钥操作失败";
                MessageBox.Show(Enc.getErrorOnce(), "创建私钥操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                toolStripStatusLabel1.Text = "创建私钥完成。";
                txtPrivatePEM.Text         = rText;
            }
        }