![]() |
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
(DataFlex) 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.
Use ChilkatAx-win32.pkg Procedure Test Variant vCert Store Handle hoCertStore Boolean iReadOnly Boolean iSuccess Variant vJsonE Handle hoJsonE Variant vCert Handle hoCert String sTemp1 Get Create (RefClass(cComChilkatCertStore)) To hoCertStore If (Not(IsComObjectCreated(hoCertStore))) Begin Send CreateComObject of hoCertStore End // The "AddressBook" is the "Other People" certificate store as shown in certmgr.msc Move True To iReadOnly Get ComOpenWindowsStore Of hoCertStore "CurrentUser" "AddressBook" iReadOnly To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoCertStore To sTemp1 Showln sTemp1 Procedure_Return End // Find the certificate for the email address: Get Create (RefClass(cComChilkatJsonObject)) To hoJsonE If (Not(IsComObjectCreated(hoJsonE))) Begin Send CreateComObject of hoJsonE End Get ComUpdateString Of hoJsonE "email" "joe@example.com" To iSuccess Get Create (RefClass(cComChilkatCert)) To hoCert If (Not(IsComObjectCreated(hoCert))) Begin Send CreateComObject of hoCert End Get pvComObject of hoJsonE to vJsonE Get pvComObject of hoCert to vCert Get ComFindCert Of hoCertStore vJsonE vCert To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoCertStore To sTemp1 Showln sTemp1 Procedure_Return End Get ComSubjectDN Of hoCert To sTemp1 Showln "Found certificate: " sTemp1 End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.