void generateKeys() { UseWaitCursor = true; string keyLength = comboBox1.SelectedValue.ToString(); textBox3.Text = RSAservice.generateKeyPair(keyLength); UseWaitCursor = false; }
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(); }
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; }
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); } } }
void getKeyLength() { //Setting.get(); comboBox1.DataSource = RSAservice.getPossibleKeyLengths(); comboBox1.SelectedIndex = comboBox1.FindStringExact(Setting.rsaKeyLength.ToString()); }