Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Load PFX (PKCS#12) and List CertificatesLoads a PFX file (.pfx, .p12) and iterates over the certificates found within. Download: Chilkat .NET Assemblies Chilkat.CertStore certStore = new Chilkat.CertStore(); bool success; string pfxPath; pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx"; string pfxPassword; pfxPassword = "test"; success = certStore.LoadPfxFile(pfxPath,pfxPassword); if (success != true) { textBox1.Text += certStore.LastErrorText + "\r\n"; return; } int i; int numCerts; numCerts = certStore.NumCertificates; textBox1.Text += "PFX contains " + Convert.ToString(numCerts) + " certificates" + "\r\n"; if (numCerts == 0) { return; } for (i = 0; i <= (numCerts - 1); i++) { Chilkat.Cert cert = null; cert = certStore.GetCertificate(i); if (!(cert == null )) { textBox1.Text += Convert.ToString(i) + ": (Common Name) " + cert.SubjectCN + "\r\n"; textBox1.Text += Convert.ToString(i) + ": (Serial Number) " + cert.SerialNumber + "\r\n"; textBox1.Text += Convert.ToString(i) + ": (Distinguished Name) " + cert.SubjectDN + "\r\n"; } } |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.