Sample code for 30+ languages & platforms
Tcl

Workaround for the deprecated Crypt2.OpaqueVerifyBytes method

Shows how to replace the deprecated OpaqueVerifyBytes method. (Chilkat is moving away from the use of CkByteData.)

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set crypt [new_CkCrypt2]

set path "c:/someDir/example.p7m"

# ------------------------------------------------------------------------
# The OpaqueVerifyBytes method is deprecated:

set inData [new_CkByteData]

CkByteData_loadFile $inData $path

set outData [new_CkByteData]

set success [CkCrypt2_OpaqueVerifyBytes $crypt $inData $outData]

# ------------------------------------------------------------------------
# Workaround.
# (Chilkat is moving away from using CkByteData)

set bd [new_CkBinData]

CkBinData_LoadFile $bd $path

# If the opaque signature is validated, the contents of bd are replaced with the original data that was signed.
set success [CkCrypt2_OpaqueVerifyBd $crypt $bd]

delete_CkCrypt2 $crypt
delete_CkByteData $inData
delete_CkByteData $outData
delete_CkBinData $bd