Perl Examples

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

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
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 Perl Module Downloads for Windows, Linux, and MAC OS X

use chilkat();

$certStore = new chilkat::CkCertStore();

$pfxPath = "/Users/chilkat/testData/pfx/chilkat_ssl.pfx";
$pfxPassword = "test";
$success = $certStore->LoadPfxFile($pfxPath,$pfxPassword);
if ($success != 1) {
    print $certStore->lastErrorText() . "\r\n";
    exit;
}

$numCerts = $certStore->get_NumCertificates();

print "PFX contains " . $numCerts . " certificates" . "\r\n";

if ($numCerts == 0) {
    exit;
}

for ($i = 0; $i <= ($numCerts - 1); $i++) {

    # cert is a CkCert
    $cert = $certStore->GetCertificate($i);
    if (!($cert eq null )) {
        print $i . ": (Common Name) " . $cert->subjectCN() . "\r\n";
        print $i . ": (Serial Number) " . $cert->serialNumber() . "\r\n";
        print $i . ": (Distinguished Name) "
             . $cert->subjectDN() . "\r\n";

    }

}

 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.