(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).
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 numCerts [CkCertStore_get_NumCertificates $certStore]
set i 0
while {$i < $numCerts} {
# cert is a CkCert
set cert [CkCertStore_GetCertificate $certStore $i]
puts "DN = [CkCert_subjectDN $cert]"
puts "Email = [CkCert_subjectE $cert]"
set i [expr $i + 1]
}
delete_CkCertStore $certStore
|