Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) Apple Keychain - List Certs on Smartcards and USB TokensSee more Apple Keychain ExamplesIterates over the certificatse on connected smartcards and USB tokens via the Apple Keychain. Note: This example requires Chilkat v10.0.0 or greater.
#include <C_CkCertStore.h> #include <C_CkCert.h> void ChilkatSample(void) { HCkCertStore certStore; BOOL success; int numCerts; int i; HCkCert cert; certStore = CkCertStore_Create(); // On MacOS and iOS, the OpenSmartcard method opens the Keychain. // The argument passed to OpenSmartcard is ignored. success = CkCertStore_OpenSmartcard(certStore,""); if (success == FALSE) { printf("%s\n",CkCertStore_lastErrorText(certStore)); CkCertStore_Dispose(certStore); return; } numCerts = CkCertStore_getNumCertificates(certStore); printf("numCerts = %d\n",numCerts); i = 0; while (i < numCerts) { // Note: Chilkat also gets the associated private key if it exists. // You can simply use the cert in other places in Chilkat where a cert w/ private key is required. cert = CkCertStore_GetCertificate(certStore,i); printf("%s\n",CkCert_subjectDN(cert)); printf("has private key: %d\n",CkCert_HasPrivateKey(cert)); CkCert_Dispose(cert); i = i + 1; } CkCertStore_CloseCertStore(certStore); CkCertStore_Dispose(certStore); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.