Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Find a Certificate in the "Other People" Windows Certificate StoreDemonstrates how to open the "Current User --> Other People" Windows certificate store, and locates a certificate matching an email address.
#include <CkCertStore.h> #include <CkCert.h> void ChilkatSample(void) { CkString strOut; CkCertStore certStore; // The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc bool readOnly = true; bool success = certStore.OpenWindowsStore("CurrentUser","AddressBook",readOnly); if (success != true) { strOut.append(certStore.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } CkCert *cert = 0; cert = certStore.FindCertByRfc822Name("sales.edifact@somewhere.com"); if (certStore.get_LastMethodSuccess() != true) { strOut.append(certStore.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } strOut.append("Found certificate: "); strOut.append(cert->subjectDN()); strOut.append("\r\n"); delete cert; SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.