private void CertificateBTN_Click(object sender, EventArgs e) { try { // determine default store. CertificateStoreIdentifier store = new CertificateStoreIdentifier(); if (m_certificate != null) { store.StoreType = m_certificate.StoreType; store.StorePath = m_certificate.StorePath; } else { store.StoreType = Utils.DefaultStoreType; store.StorePath = Utils.DefaultStorePath; } // select the certificate. CertificateIdentifier certificate = new CertificateListDlg().ShowDialog(store, true); if (certificate != null) { m_certificate = certificate; X509Certificate2 certificate2 = m_certificate.Find(); if (certificate2 != null) { CertificateTB.Text = certificate2.Subject; } else { CertificateTB.Text = m_certificate.ToString(); } } } catch (Exception exception) { GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception); } }
private void CertificateBTN_Click(object sender, EventArgs e) { try { CertificateStoreIdentifier store = new CertificateStoreIdentifier(); store.StoreType = m_certificate.StoreType; store.StorePath = m_certificate.StorePath; CertificateIdentifier certificate = new CertificateListDlg().ShowDialog(store, true); if (certificate != null) { m_certificate = certificate; CertificateTB.Text = m_certificate.Thumbprint; } } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }