(Perl) 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).
use chilkat();
# 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 = chilkat::CkCertStore->new();
$readOnly = 1;
$success = $certStore->OpenCurrentUserStore($readOnly);
if ($success == 0) {
print $certStore->lastErrorText() . "\r\n";
exit;
}
$numCerts = $certStore->get_NumCertificates();
$i = 0;
while ($i < $numCerts) {
# cert is a Cert
$cert = $certStore->GetCertificate($i);
print "DN = " . $cert->subjectDN() . "\r\n";
print "Email = " . $cert->subjectE() . "\r\n";
$i = $i + 1;
}
|