Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3/4 Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(C# UWP/WinRT) Load PFX (PKCS#12) and List CertificatesLoads a PFX file (.pfx, .p12) and iterates over the certificates found within.
Chilkat.CertStore certStore = new Chilkat.CertStore(); bool success; string pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx"; string pfxPassword = "test"; success = certStore.LoadPfxFile(pfxPath,pfxPassword); if (success != true) { Debug.WriteLine(certStore.LastErrorText); return; } int i; int numCerts = certStore.NumCertificates; Debug.WriteLine("PFX contains " + Convert.ToString(numCerts) + " certificates"); if (numCerts == 0) { return; } for (i = 0; i <= (numCerts - 1); i++) { Chilkat.Cert cert = null; cert = certStore.GetCertificate(i); if (!(cert == null )) { Debug.WriteLine(Convert.ToString(i) + ": (Common Name) " + cert.SubjectCN); Debug.WriteLine(Convert.ToString(i) + ": (Serial Number) " + cert.SerialNumber); Debug.WriteLine(Convert.ToString(i) + ": (Distinguished Name) " + cert.SubjectDN); } } |
© 2000-2016 Chilkat Software, Inc. All Rights Reserved.