private void openKeyToolStripMenuItem_Click(object sender, EventArgs e) { listView1.Items.Clear(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { cert_mgmt.applied_certs = new X509Certificate2Collection(); key_path = openFileDialog1.FileName; // read the file fileBytes = File.ReadAllBytes(key_path); this.Text = "Loaded key: " + key_path; DialogResult key_question = MessageBox.Show("Do you want to oben a keyring file?", "Keyring", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (key_question == DialogResult.Yes) { readkeyring(); } cert_mgmt.getRecipient(fileBytes); addToList(cert_mgmt.removeDuplicates(cert_mgmt.applied_certs)); } catch (IOException) { MessageBox.Show("Can't read file!"); } } }
private void openKeyToolStripMenuItem_Click(object sender, EventArgs e) { listView1.Items.Clear(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { cert_mgmt.applied_certs = new X509Certificate2Collection(); key_path = openFileDialog1.FileName; // read the file fileBytes = File.ReadAllBytes(key_path); this.Text = "Loaded key: " + key_path; cert_mgmt.getRecipient(fileBytes); addToList(cert_mgmt.applied_certs); } catch (IOException) { MessageBox.Show("Can't read file!"); } } }