|  | 
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) Load PFX (PKCS#12) and List CertificatesLoads a PFX file (.pfx, .p12) and iterates over the certificates found within. Note: This example requires Chilkat v10.1.2 or greater. 
 #include <C_CkCertStoreW.h> #include <C_CkCertW.h> void ChilkatSample(void) { HCkCertStoreW certStore; BOOL success; const wchar_t *pfxPath; const wchar_t *pfxPassword; int numCerts; HCkCertW cert; int i; certStore = CkCertStoreW_Create(); pfxPath = L"/Users/chilkat/testData/pfx/chilkat_ssl.pfx"; pfxPassword = L"test"; success = CkCertStoreW_LoadPfxFile(certStore,pfxPath,pfxPassword); if (success != TRUE) { wprintf(L"%s\n",CkCertStoreW_lastErrorText(certStore)); CkCertStoreW_Dispose(certStore); return; } numCerts = CkCertStoreW_getNumCertificates(certStore); wprintf(L"PFX contains %d certificates\n",numCerts); cert = CkCertW_Create(); i = 0; while (i < numCerts) { CkCertStoreW_GetCert(certStore,i,cert); wprintf(L"%d: (Common Name) %s\n",i,CkCertW_subjectCN(cert)); wprintf(L"%d: (Serial Number) %s\n",i,CkCertW_serialNumber(cert)); wprintf(L"%d: (Distinguished Name) %s\n",i,CkCertW_subjectDN(cert)); i = i + 1; } CkCertStoreW_Dispose(certStore); CkCertW_Dispose(cert); } | ||||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.