Sample code for 30+ languages & platforms
Tcl Requires Chilkat v11.0.0+

Transition from Crypt2.GetDecryptCert to Crypt2.LastDecryptCert

Provides instructions for replacing deprecated GetDecryptCert method calls with LastDecryptCert.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set crypt2 [new_CkCrypt2]

#  ...
#  ...

#  ------------------------------------------------------------------------
#  The GetDecryptCert method is deprecated:

# certObj is a CkCert
set certObj [CkCrypt2_GetDecryptCert $crypt2]
if {[CkCrypt2_get_LastMethodSuccess $crypt2] == 0} then {
    puts [CkCrypt2_lastErrorText $crypt2]
    delete_CkCrypt2 $crypt2
    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 [CkCrypt2_LastDecryptCert $crypt2 $certOut]
if {$success == 0} then {
    puts [CkCrypt2_lastErrorText $crypt2]
    delete_CkCrypt2 $crypt2
    delete_CkCert $certOut
    exit
}


delete_CkCrypt2 $crypt2
delete_CkCert $certOut