(PHP Extension) List Certificates in the Current User Certificate Store (Windows Only)
This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).
<?php
include("chilkat.php");
// Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0
// This is a Windows-only example because it lists the certificates
// stored in the Windows Current User Certificate Store located in the
// Windows Registry.
$certStore = new CkCertStore();
$readOnly = true;
$success = $certStore->OpenCurrentUserStore($readOnly);
if ($success == false) {
print $certStore->lastErrorText() . "\n";
exit;
}
$numCerts = $certStore->get_NumCertificates();
$i = 0;
while ($i < $numCerts) {
// cert is a CkCert
$cert = $certStore->GetCertificate($i);
print 'DN = ' . $cert->subjectDN() . "\n";
print 'Email = ' . $cert->subjectE() . "\n";
$i = $i + 1;
}
?>
|