Chilkat HOME ASP Visual Basic VB.NET C# C C++ MFC Delphi FoxPro Java Perl Python Ruby SQL Server VBScript
Load PFX (PKCS#12) and List CertificatesLoads a PFX file (.pfx, .p12) and iterates over the certificates found within. <?php $certStore = new COM("Chilkat.CertStore"); $pfxPath = '/Users/chilkat/testData/pfx/chilkat_ssl.pfx'; $pfxPassword = 'test'; $success = $certStore->LoadPfxFile($pfxPath,$pfxPassword); if ($success != true) { print $certStore->lastErrorText() . "\n"; exit; } $numCerts = $certStore->NumCertificates; print 'PFX contains ' . $numCerts . ' certificates' . "\n"; if ($numCerts == 0) { exit; } for ($i = 0; $i <= ($numCerts - 1); $i++) { // cert is a Chilkat.Cert $cert = $certStore->GetCertificate($i); if (!(is_null($cert))) { print $i . ': (Common Name) ' . $cert->subjectCN() . "\n"; print $i . ': (Serial Number) ' . $cert->serialNumber() . "\n"; print $i . ': (Distinguished Name) ' . $cert->subjectDN() . "\n"; } } ?> |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.