Tcl
Tcl
Load Certificate from Smartcard in Reader (or from USB Token)
See more Certificates Examples
Demonstrates how to load the certificate that is on the smartcard currently inserted into the smartcard reader. (Also can load the smartcard on a USB token.)Chilkat Tcl Downloads
load ./chilkat.dll
set success 0
set cert [new_CkCert]
# If you know the smart card PIN, set it prior to loading from the smartcard/USB token.
CkCert_put_SmartCardPin $cert "12345678"
# Pass an empty string to allow Chilkat to discover the smart card or USB token automatically.
set success [CkCert_LoadFromSmartcard $cert ""]
if {$success == 0} then {
puts [CkCert_lastErrorText $cert]
delete_CkCert $cert
exit
}
puts "Cert loaded from smartcard: [CkCert_subjectCN $cert]"
delete_CkCert $cert