Tcl
Tcl
Example: Crypt2.LastSignerCert method
Demonstrates how to call the LastSignerCert method.Chilkat Tcl Downloads
load ./chilkat.dll
set success 0
set crypt [new_CkCrypt2]
set p7m_path "qa_data/p7m/Firma.docx.p7m"
set out_path "qa_output/Firma.docx"
set success [CkCrypt2_VerifyP7M $crypt $p7m_path $out_path]
if {$success == 0} then {
puts [CkCrypt2_lastErrorText $crypt]
delete_CkCrypt2 $crypt
exit
}
# Examine the certificate(s) used for signing.
set numSigners [CkCrypt2_get_NumSignerCerts $crypt]
set i 0
set cert [new_CkCert]
while {$i < $numSigners} {
CkCrypt2_LastSignerCert $crypt $i $cert
puts "Signer: [CkCert_subjectDN $cert]"
set i [expr $i + 1]
}
delete_CkCrypt2 $crypt
delete_CkCert $cert