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
(PureBasic) 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.
IncludeFile "CkCert.pb" IncludeFile "CkCertStore.pb" Procedure ChilkatExample() certStore.i = CkCertStore::ckCreate() If certStore.i = 0 Debug "Failed to create object." ProcedureReturn EndIf ; On MacOS and iOS, the OpenSmartcard method opens the Keychain. ; The argument passed to OpenSmartcard is ignored. success.i = CkCertStore::ckOpenSmartcard(certStore,"") If success = 0 Debug CkCertStore::ckLastErrorText(certStore) CkCertStore::ckDispose(certStore) ProcedureReturn EndIf numCerts.i = CkCertStore::ckNumCertificates(certStore) Debug "numCerts = " + Str(numCerts) i.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.i = CkCertStore::ckGetCertificate(certStore,i) Debug CkCert::ckSubjectDN(cert) Debug CkCert::ckSubjectCN(cert) Debug CkCert::ckSerialNumber(cert) Debug "has private key: " + Str(CkCert::ckHasPrivateKey(cert)) Debug "----" CkCert::ckDispose(cert) i = i + 1 Wend CkCertStore::ckCloseCertStore(certStore) CkCertStore::ckDispose(certStore) ProcedureReturn EndProcedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.