(Tcl) 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). Note: This example requires Chilkat v10.1.2 or greater.
load ./chilkat.dll
# This is a Windows-only example because it lists the certificates
# stored in the Windows Current User Certificate Store located in the
# Windows Registry.
set certStore [new_CkCertStore]
set readOnly 1
set success [CkCertStore_OpenCurrentUserStore $certStore $readOnly]
if {$success == 0} then {
puts [CkCertStore_lastErrorText $certStore]
delete_CkCertStore $certStore
exit
}
set cert [new_CkCert]
set numCerts [CkCertStore_get_NumCertificates $certStore]
set i 0
while {$i < $numCerts} {
CkCertStore_GetCert $certStore $i $cert
puts "DN = [CkCert_subjectDN $cert]"
puts "Email = [CkCert_subjectE $cert]"
set i [expr $i + 1]
}
delete_CkCertStore $certStore
delete_CkCert $cert
|