(PHP Extension) Load CMS PKCS#7 Certificate (.p7b)
Loads a digital certificate from a Cryptographic Message Syntax Standard PKCS7 (.p7b) file and fetches information about the cert.
<?php
include("chilkat.php");
// Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0
$cert = new CkCert();
// LoadFromFile will load virtually any certificate format file.
// It will auto-recognize the format and load appropiately.
$success = $cert->LoadFromFile('/Users/chilkat/testData/cer/chilkat.p7b');
if ($success != true) {
print $cert->lastErrorText() . "\n";
exit;
}
// DN = "Distinguished Name"
print 'SubjectDN:' . $cert->subjectDN() . "\n";
print 'Common Name:' . $cert->subjectCN() . "\n";
print 'Issuer Common Name:' . $cert->issuerCN() . "\n";
print 'Serial Number:' . $cert->serialNumber() . "\n";
?>
|