Example #1
0
        void signMessage()
        {
            using (FrmSelectKey frmSelectKey = new FrmSelectKey(0))
            {
                frmSelectKey.ShowDialog(this);
            }

            if (key != null)
            {
                string msg = textBox1.Text;
                msgSign = RSAservice.sign(key, msg);
            }

            key = null;
        }
Example #2
0
        void verifySign()
        {
            using (FrmSelectKey frmSelectKey = new FrmSelectKey(1))
            {
                frmSelectKey.ShowDialog(this);
            }

            if (key != null)
            {
                string msg = textBox1.Text;

                if (RSAservice.verify(key, msg, msgSign))
                {
                    MessageBox.Show("Podpis prawidłowy!", "Weryfikacja", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Podpis nieprawidłowy!", "Weryfikacja", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }