Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Win32 Support: Subroutines for Windows SSL support.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 12 May 2016 20:21:32 +0000 (21:21 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 12 May 2016 20:21:32 +0000 (21:21 +0100)
New subroutines BuildCertificateData(CardDAV*, HWND) and BuildCertificateData(CERT_CONTEXT, HWND).

source/common/win32ssl.cpp [new file with mode: 0644]
source/common/win32ssl.h [new file with mode: 0644]

diff --git a/source/common/win32ssl.cpp b/source/common/win32ssl.cpp
new file mode 100644 (file)
index 0000000..853cabe
--- /dev/null
@@ -0,0 +1,54 @@
+// win32ssl.cpp - Win32 SSPI (SSL) support.
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#include "win32ssl.h"
+
+CRYPTUI_VIEWCERTIFICATE_STRUCTW BuildCertificateData(CardDAV *CardDAVConnection, HWND WindowHandle){
+
+       PCCERT_CONTEXT CertificateContext = CardDAVConnection->GetCertificateContextPointer();
+       HCERTSTORE CertificateStore = CertificateContext->hCertStore;
+       CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = { 0 };
+       CertificateData.hwndParent = WindowHandle;
+       CertificateData.dwFlags = CRYPTUI_ENABLE_ADDTOSTORE | CRYPTUI_DISABLE_HTMLLINK;
+       CertificateData.pCertContext = CertificateContext;
+       CertificateData.cStores = 1;
+       CertificateData.rghStores = &CertificateStore;
+       CertificateData.szTitle = _("Certificate Information");
+       CertificateData.nStartPage = 0;
+       CertificateData.dwSize = sizeof(CertificateData);
+
+       return CertificateData;
+
+}
+
+CRYPTUI_VIEWCERTIFICATE_STRUCTW BuildCertificateData(CERT_CONTEXT CertificateContext, HWND WindowHandle){
+
+       HCERTSTORE CertificateStore = CertificateContext.hCertStore;
+       CRYPTUI_VIEWCERTIFICATE_STRUCTW CertificateData = { 0 };
+       CertificateData.hwndParent = WindowHandle;
+       CertificateData.dwFlags = CRYPTUI_DISABLE_HTMLLINK;
+       CertificateData.pCertContext = &CertificateContext;
+       CertificateData.cStores = 1;
+       CertificateData.rghStores = &CertificateStore;
+       CertificateData.szTitle = _("Certificate Information");
+       CertificateData.nStartPage = 0;
+       CertificateData.dwSize = sizeof(CertificateData);
+
+       return CertificateData;
+
+}
\ No newline at end of file
diff --git a/source/common/win32ssl.h b/source/common/win32ssl.h
new file mode 100644 (file)
index 0000000..35dede4
--- /dev/null
@@ -0,0 +1,37 @@
+// win32ssl.h - Win32 SSPI (SSL) support.
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
+#ifndef __COMMON_WIN32SSL_H__
+#define __COMMON_WIN32SSL_H__
+
+#pragma once
+
+#include <Windows.h>
+#include <basetsd.h>
+#include <winapifamily.h>
+#include <security.h>
+#include <schannel.h>
+#include <cryptuiapi.h>
+#include <sspi.h>
+
+#include "../carddav/carddav.h"
+
+CRYPTUI_VIEWCERTIFICATE_STRUCTW BuildCertificateData(CardDAV *CardDAVConnection, HWND WindowHandle);
+CRYPTUI_VIEWCERTIFICATE_STRUCTW BuildCertificateData(CERT_CONTEXT CertificateContext, HWND WindowHandle);
+
+#endif
\ No newline at end of file
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