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.
import sys import chilkat certStore = chilkat.CkCertStore() pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx" pfxPassword = "test" success = certStore.LoadPfxFile(pfxPath,pfxPassword) if (success != True): print certStore.lastErrorText() sys.exit() numCerts = certStore.get_NumCertificates() print "PFX contains " + str(numCerts) + " certificates" if (numCerts == 0): sys.exit() for i in range(0,((numCerts - 1))-1): # cert is a CkCert cert = certStore.GetCertificate(i) if (not (cert == None )): print str(i) + ": (Common Name) " + cert.subjectCN() print str(i) + ": (Serial Number) " + cert.serialNumber() print str(i) + ": (Distinguished Name) "\ + cert.subjectDN() |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.