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
(Java) Apple Keychain - List CertificatesSee more Apple Keychain ExamplesIterates over the certificates in the Apple Keychain. Note: This example requires Chilkat v10.0.0 or greater.
import com.chilkatsoft.*; public class ChilkatExample { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); System.exit(1); } } public static void main(String argv[]) { CkCertStore certStore = new CkCertStore(); // On MacOS and iOS, the OpenCurrentUserStore method opens the Keychain. // The argument passed to OpenCurrentUserStore is ignored. boolean success = certStore.OpenCurrentUserStore(false); if (success == false) { System.out.println(certStore.lastErrorText()); return; } int numCerts = certStore.get_NumCertificates(); System.out.println("numCerts = " + numCerts); int i = 0; while (i < numCerts) { CkCert cert = certStore.GetCertificate(i); System.out.println(cert.subjectDN()); System.out.println(cert.subjectCN()); System.out.println(cert.serialNumber()); System.out.println("----"); i = i+1; } certStore.CloseCertStore(); } } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.