Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Win32 Support: Added support for displaying the certificate information using the...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 16 May 2016 20:33:36 +0000 (21:33 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 16 May 2016 20:33:36 +0000 (21:33 +0100)
source/frmMain.cpp

index 026b9e9..fad8469 100644 (file)
@@ -2531,7 +2531,63 @@ void frmMain::ShowSSLCertificates( wxCommandEvent &event ){
                 AccType.clear();
                 
         }
-    
+   
+#elif defined(__WIN32__)
+
+       std::map<int, PCCERT_CONTEXT>::iterator SSLCertificateIter;
+
+       for (int i = 0; i < prefaccounts.GetCount(); i++){
+
+               SeekAccount.Append(prefaccounts.GetAccountDirectory(i));
+               AccType.Append(prefaccounts.GetAccountType(i));
+               AccountSSL = prefaccounts.GetAccountSSL(i);
+               AccTypeLower = AccType.MakeLower();
+               SeekAccount.Append(wxT("."));
+               SeekAccount.Append(AccTypeLower);
+
+               if (SeekAccount == ActiveAccount){
+
+                       if (AccTypeLower == wxT("local")){
+
+                               return;
+
+                       }
+
+                       if (AccountSSL == false){
+
+                               return;
+
+                       }
+
+                       SSLCertificateIter = AccountCertificateData.find(i);
+
+                       // Setup and display the form.
+
+                       if (SSLCertificateIter->second->pCertInfo == NULL){
+
+                               wxMessageBox("No certificate information is available due to invalid connection details, connection being in progress or invalid certificate data received.");
+
+                       } else {
+
+                               BOOL ModifiedCertificateData;
+                               CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = BuildCertificateData(SSLCertificateIter->second, (HWND)this->GetHandle());
+
+                               if (!CryptUIDlgViewCertificate(&CertificateData, &ModifiedCertificateData)){
+                                       wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog"));
+                               }
+
+                       }
+
+                       //DisplayCertificate(SSLTrustIter->second);
+
+               }
+
+               SeekAccount.Clear();
+               AccTypeLower.Clear();
+               AccType.clear();
+
+       }
+
 #else
     
        std::map<int, SSLCertCollection>::iterator SSLColIter;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy