(Tcl) Example: Crypt2.ClearSigningCerts method
Demonstrates how to call the ClearSigningCerts method.
load ./chilkat.dll
set crypt [new_CkCrypt2]
set success 0
# Tell the crypt object to use 3 certificates.
# Do this by calling AddSigningCert for each certificate.
set cert1 [new_CkCert]
# ...
# Load the cert from a source such as a .pfx/.p12 file, smart card, USB token, Apple keychain, Windows certificate store, etc.
# ...
CkCrypt2_AddSigningCert $crypt $cert1
set cert2 [new_CkCert]
# ...
CkCrypt2_AddSigningCert $crypt $cert2
set cert3 [new_CkCert]
# ...
CkCrypt2_AddSigningCert $crypt $cert3
set bd [new_CkBinData]
# ...
set success [CkCrypt2_OpaqueSignBd $crypt $bd]
# Let's say we now want to sign something else with different certs..
# First clear the signing certs.
CkCrypt2_ClearSigningCerts $crypt
set cert4 [new_CkCert]
# ...
CkCrypt2_AddSigningCert $crypt $cert4
set cert5 [new_CkCert]
# ...
CkCrypt2_AddSigningCert $crypt $cert5
# ...
# ...
# Sign using cert4 and cert5.
set success [CkCrypt2_OpaqueSignBd $crypt $bd]
delete_CkCrypt2 $crypt
delete_CkCert $cert1
delete_CkCert $cert2
delete_CkCert $cert3
delete_CkBinData $bd
delete_CkCert $cert4
delete_CkCert $cert5
|