Sample code for 30+ languages & platforms
Tcl

Windows Certificate Stores - Find Certificate by Common Name

See more Certificates Examples

Searches the Windows certificate stores for a certificate that matches the specified common name (CN).

Note: This example requires Chilkat v10.0.0 or greater.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set cert [new_CkCert]

set success [CkCert_LoadByCommonName $cert "Chilkat Software, Inc."]
if {$success == 0} then {
    puts [CkCert_lastErrorText $cert]
    delete_CkCert $cert
    exit
}

puts [CkCert_subjectDN $cert]
puts "Success."

delete_CkCert $cert