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
(PHP Extension) 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.
<?php include("chilkat.php"); // Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0 $certStore = new CkCertStore(); // On MacOS and iOS, the OpenSmartcard method opens the Keychain. // The argument passed to OpenSmartcard is ignored. $success = $certStore->OpenSmartcard(''); if ($success == false) { print $certStore->lastErrorText() . "\n"; exit; } $numCerts = $certStore->get_NumCertificates(); print 'numCerts = ' . $numCerts . "\n"; $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 is a CkCert $cert = $certStore->GetCertificate($i); print $cert->subjectDN() . "\n"; print $cert->subjectCN() . "\n"; print $cert->serialNumber() . "\n"; print 'has private key: ' . $cert->HasPrivateKey() . "\n"; print '----' . "\n"; $i = $i + 1; } $certStore->CloseCertStore(); ?> |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.