Exemplo n.º 1
0
 private void descriptionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         ListViewItem it  = CertificatesList.SelectedItems[0];
         GXTextDlg    dlg = new GXTextDlg("Certificate description.", "Certificate description:", it.SubItems[6].Text);
         if (dlg.ShowDialog(Parent) == DialogResult.OK)
         {
             string            desc = dlg.GetValue();
             GXx509Certificate cert = GXx509Certificate.Load((string)it.Tag);
             cert.Description = desc;
             cert.Save((string)it.Tag);
             it.SubItems[6].Text = desc;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Parent, ex.Message);
     }
 }
Exemplo n.º 2
0
 private void RenameMnu_Click(object sender, EventArgs e)
 {
     try
     {
         ListViewItem it  = CertificatesList.SelectedItems[0];
         GXTextDlg    dlg = new GXTextDlg("Rename certificate file.", "Certificate name:", it.SubItems[5].Text);
         if (dlg.ShowDialog(Parent) == DialogResult.OK)
         {
             string path = dlg.GetValue();
             path = Path.Combine(CertificateFolder, Path.GetFileNameWithoutExtension(path)) + ".pem";
             File.Move(Path.Combine(CertificateFolder, it.SubItems[5].Text) + ".pem", path);
             it.SubItems[5].Text = Path.GetFileNameWithoutExtension(path);
             it.Tag = path;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Parent, ex.Message);
     }
 }