Python Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Python Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
Socket / SSL
SFTP
SMTP
Spider
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Load PFX (PKCS#12) and List Certificates

Loads a PFX file (.pfx, .p12) and iterates over the certificates found within.

 Chilkat Python Module Downloads for Windows, Linux, and MAC OS X

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.