(Tcl) Transition from Email.GetEncryptedByCert to Email.LastDecryptCert
Provides instructions for replacing deprecated GetEncryptedByCert method calls with LastDecryptCert. Note: This example requires Chilkat v11.0.0 or greater.
load ./chilkat.dll
set email [new_CkEmail]
# ...
# ...
# ------------------------------------------------------------------------
# The GetEncryptedByCert method is deprecated:
# certObj is a CkCert
set certObj [CkEmail_GetEncryptedByCert $email]
if {[CkEmail_get_LastMethodSuccess $email] == 0} then {
puts [CkEmail_lastErrorText $email]
delete_CkEmail $email
exit
}
# ...
# ...
delete_CkCert $certObj
# ------------------------------------------------------------------------
# Do the equivalent using LastDecryptCert.
# Your application creates a new, empty Cert object which is passed
# in the last argument and filled upon success.
set certOut [new_CkCert]
set success [CkEmail_LastDecryptCert $email $certOut]
if {$success == 0} then {
puts [CkEmail_lastErrorText $email]
delete_CkEmail $email
delete_CkCert $certOut
exit
}
delete_CkEmail $email
delete_CkCert $certOut
|