private void btnLoadFile_Click(object sender, EventArgs e) { using (LoadCertFromFileForm frm = new LoadCertFromFileForm()) { if (frm.ShowDialog(this) == DialogResult.OK) { _specifyCert = frm.Certificate; textBoxSubject.Text = _specifyCert.Subject; } } }
private void viewCertToolStripMenuItem_Click(object sender, EventArgs e) { using (LoadCertFromFileForm frm = new LoadCertFromFileForm()) { frm.NoPrivateKey = true; if (frm.ShowDialog(this) == DialogResult.OK) { X509Certificate2UI.DisplayCertificate(frm.Certificate, this.Handle); } } }
private void btnLoadFileCert_Click(object sender, EventArgs e) { using (LoadCertFromFileForm frm = new LoadCertFromFileForm()) { frm.NoPrivateKey = true; if (frm.ShowDialog(this) == DialogResult.OK) { _templateCert = frm.Certificate; textBoxCN.Text = _templateCert.Subject; } } }
private X509Certificate2 LoadCertFromFile() { using (LoadCertFromFileForm frm = new LoadCertFromFileForm()) { if (frm.ShowDialog(this) == DialogResult.OK) { return frm.Certificate; } } return null; }