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) List Certificates in the Current User Certificate Store (Windows Only)This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).
#include <CkCertStore.h> #include <CkCert.h> void ChilkatSample(void) { CkString strOut; // This is a Windows-only example because it lists the certificates // stored in the Windows Current User Certificate Store located in the // Windows Registry. CkCertStore certStore; bool readOnly = true; bool success = certStore.OpenCurrentUserStore(readOnly); if (success == false) { strOut.append(certStore.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } int numCerts = certStore.get_NumCertificates(); int i = 0; while (i < numCerts) { CkCert *cert = certStore.GetCertificate(i); strOut.append("DN = "); strOut.append(cert->subjectDN()); strOut.append("\r\n"); strOut.append("Email = "); strOut.append(cert->subjectE()); strOut.append("\r\n"); i = i + 1; } SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.