private void button1_Click_1(object sender, EventArgs e) { string pubKey=MerMail.Asymmetric.generateKeys(Convert.ToInt16(bytestrengthNum.Value)); if (pubKey != null) { bool succes = true; try { public_key = MerMail.Asymmetric.parseKeyXML(System.IO.File.OpenText(pubKey).ReadToEnd()); } catch (Exception err) { succes = false; } if (succes) { asymKeyFilename.Text = new System.IO.FileInfo(pubKey).Name; validAsymmetric = true; } else { validAsymmetric = false; } } updateControls(); }
private void button1_Click_1(object sender, EventArgs e) { string pubKey = MerMail.Asymmetric.generateKeys(Convert.ToInt16(bytestrengthNum.Value)); if (pubKey != null) { bool succes = true; try { public_key = MerMail.Asymmetric.parseKeyXML(System.IO.File.OpenText(pubKey).ReadToEnd()); } catch (Exception err) { succes = false; } if (succes) { asymKeyFilename.Text = new System.IO.FileInfo(pubKey).Name; validAsymmetric = true; } else { validAsymmetric = false; } } updateControls(); }
private void loadAsymmetricFromFileBtn_Click(object sender, EventArgs e) { asymmetricFileRadio.Checked = true; MerMail.Program.MFile file = MerMail.Program.openFile("publickey.pke", "Open public key", "Private key (*.pke)", "*.pke"); if (file.valid) { bool succes = true; try { public_key = MerMail.Asymmetric.parseKeyXML(file.data); } catch (Exception err) { succes = false; } if (succes) { asymKeyFilename.Text = file.filename; validAsymmetric = true; } else { validAsymmetric = false; } } else { validAsymmetric = false; } updateControls(); }