![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) 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. Note: This example requires Chilkat v10.1.2 or greater.
#include <C_CkCertStore.h> #include <C_CkJsonObject.h> #include <C_CkCert.h> void ChilkatSample(void) { HCkCertStore certStore; BOOL readOnly; BOOL success; HCkJsonObject jsonE; HCkCert cert; certStore = CkCertStore_Create(); // The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc readOnly = TRUE; success = CkCertStore_OpenWindowsStore(certStore,"CurrentUser","AddressBook",readOnly); if (success != TRUE) { printf("%s\n",CkCertStore_lastErrorText(certStore)); CkCertStore_Dispose(certStore); return; } // Find the certificate for the email address: jsonE = CkJsonObject_Create(); CkJsonObject_UpdateString(jsonE,"email","joe@example.com"); cert = CkCert_Create(); success = CkCertStore_FindCert(certStore,jsonE,cert); if (success == FALSE) { printf("%s\n",CkCertStore_lastErrorText(certStore)); CkCertStore_Dispose(certStore); CkJsonObject_Dispose(jsonE); CkCert_Dispose(cert); return; } printf("Found certificate: %s\n",CkCert_subjectDN(cert)); CkCertStore_Dispose(certStore); CkJsonObject_Dispose(jsonE); CkCert_Dispose(cert); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.