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. Downloads for Windows/Linux and Install Instructions require 'chilkat' certStore = Chilkat::CkCertStore.new() pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx" pfxPassword = "test" success = certStore.LoadPfxFile(pfxPath,pfxPassword) if (success != true) print certStore.lastErrorText() + "\n"; exit end numCerts = certStore.get_NumCertificates() print "PFX contains " + numCerts.to_s() + " certificates" + "\n"; if (numCerts == 0) exit end for i in 0 .. (numCerts - 1) # cert is a CkCert cert = certStore.GetCertificate(i) if (!(cert == nil )) print i.to_s() + ": (Common Name) " + cert.subjectCN() + "\n"; print i.to_s() + ": (Serial Number) " + cert.serialNumber() + "\n"; print i.to_s() + ": (Distinguished Name) " + cert.subjectDN() + "\n"; end end |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.