|  | 
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
| (Unicode 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_CkCertStoreW.h> #include <C_CkJsonObjectW.h> #include <C_CkCertW.h> void ChilkatSample(void) { HCkCertStoreW certStore; BOOL readOnly; BOOL success; HCkJsonObjectW jsonE; HCkCertW cert; certStore = CkCertStoreW_Create(); // The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc readOnly = TRUE; success = CkCertStoreW_OpenWindowsStore(certStore,L"CurrentUser",L"AddressBook",readOnly); if (success != TRUE) { wprintf(L"%s\n",CkCertStoreW_lastErrorText(certStore)); CkCertStoreW_Dispose(certStore); return; } // Find the certificate for the email address: jsonE = CkJsonObjectW_Create(); CkJsonObjectW_UpdateString(jsonE,L"email",L"joe@example.com"); cert = CkCertW_Create(); success = CkCertStoreW_FindCert(certStore,jsonE,cert); if (success == FALSE) { wprintf(L"%s\n",CkCertStoreW_lastErrorText(certStore)); CkCertStoreW_Dispose(certStore); CkJsonObjectW_Dispose(jsonE); CkCertW_Dispose(cert); return; } wprintf(L"Found certificate: %s\n",CkCertW_subjectDN(cert)); CkCertStoreW_Dispose(certStore); CkJsonObjectW_Dispose(jsonE); CkCertW_Dispose(cert); } | ||||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.