Example #1
0
        void generateKeys()
        {
            UseWaitCursor = true;
            string keyLength = comboBox1.SelectedValue.ToString();

            textBox3.Text = RSAservice.generateKeyPair(keyLength);
            UseWaitCursor = false;
        }
Example #2
0
        void startup()
        {
            comboBox1.DataSource = RSAservice.getPossibleKeyLengths();
            //comboBox3.DataSource = MyKey.getKeyNames();
            numericUpDown2.Value = 32;

            textBox4.Enabled = false;
            textBox5.Enabled = false;
            //comboBox3.Enabled = false;
            button1.Enabled = false;
            button2.Enabled = false;
            loadSettings();
        }
Example #3
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 #4
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);
                }
            }
        }
Example #5
0
 void getKeyLength()
 {
     //Setting.get();
     comboBox1.DataSource    = RSAservice.getPossibleKeyLengths();
     comboBox1.SelectedIndex = comboBox1.FindStringExact(Setting.rsaKeyLength.ToString());
 }