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
(Mono C#) Open Smartcard Certificate Store (or from USB Token)Demonstrates how to open the certificate store of the smart card currently in the reader (or the USB token). Iterates over the certs found on the smartcard. Note: This example requires Chilkat v9.5.0.80 or later.
Chilkat.CertStore certStore = new Chilkat.CertStore(); // Access the certificates on the smart card via the Chilkat certificate store class. // Note: Always pass the empty string to OpenSmartcard. // Also, the Chilkat CertStore class can only use MS CNG or CryptoAPI. // Some smartcard/USB token drivers only support PKCS11 or ScMinidriver. // You may get better results using Chilkat.Cert.LoadFromSmartcard because // Cert.LoadFromSmartcard can automatically detect and utilize PKCS11, ScMinidriver, CNG, and CryptoAPI. bool success = certStore.OpenSmartcard(""); if (success == false) { Debug.WriteLine(certStore.LastErrorText); return; } // Iterate over certificates on the smartcard. int i = 0; int numCerts = certStore.NumCertificates; Debug.WriteLine("numCerts = " + Convert.ToString(numCerts)); while ((i < numCerts)) { Chilkat.Cert cert = certStore.GetCertificate(i); Debug.WriteLine(cert.SubjectCN); i = i + 1; } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.