예제 #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.CheckInput())
     {
         // 丛文件中读取签名密码是否正确
         this.PrivateKey = SecretUtil.GetPrivateKey(this.txtDigitalSignature.Text, this.txtSignedPassword.Text);
         if (string.IsNullOrEmpty(this.PrivateKey))
         {
             MessageBox.Show(AppMessage.Format(AppMessage.MSG0040, AppMessage.MSGS864), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.txtSignedPassword.Focus();
             this.txtSignedPassword.SelectAll();
             return;
         }
         if (!string.IsNullOrEmpty(this.DataToSign))
         {
             this.SignedData   = SecretUtil.HashAndSign(this.DataToSign, this.PrivateKey);
             this.DialogResult = DialogResult.OK;
         }
         this.Close();
     }
 }