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) Find Certificate by Serial NumberSee more Cert Store ExamplesDemonstrates how to find a certificate having the specified hexadecimal serial number. Note: Requires Chilkat v10.1.2 or later.
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(); // This example will search the certs on connected USB tokens and smartcards. String argNotUsed = ""; boolean success = certStore.OpenSmartcard(argNotUsed); if (success == false) { System.out.println(certStore.lastErrorText()); return; } // Find the certificate having a serial number = "48FC93B46055948D36A7C98A89D69416". String hexSerial = "48FC93B46055948D36A7C98A89D69416"; CkJsonObject json = new CkJsonObject(); json.UpdateString("serial",hexSerial); CkCert cert = new CkCert(); success = certStore.FindCert(json,cert); if (success == true) { // Show the serial number and subject CN System.out.println("Found: " + cert.serialNumber() + ", " + cert.subjectCN()); } else { System.out.println("Not found."); } } } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.