PHP Extension
PHP Extension
List Certificates in the Current User Certificate Store (Windows Only)
See more Certificates Examples
This is a Windows-only example to list the certificates in the current-user certificate store (located in the Windows Registry).Chilkat PHP Extension Downloads
<?php
include("chilkat.php");
$success = false;
// 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;
}
$cert = new CkCert();
$numCerts = $certStore->get_NumCertificates();
$i = 0;
while ($i < $numCerts) {
$certStore->GetCert($i,$cert);
print 'DN = ' . $cert->subjectDN() . "\n";
print 'Email = ' . $cert->subjectE() . "\n";
$i = $i + 1;
}
?>