Sample code for 30+ languages & platforms
Tcl

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set crypt [new_CkCrypt2]

set success 0

# Do public-key decryption (RSA)
CkCrypt2_put_CryptAlgorithm $crypt "pki"

# ...
# ...
# ...

set bdPfx [new_CkBinData]

set success [CkBinData_LoadFile $bdPfx "c:/my_pfx_files/a.pfx"]
# ...

set pfxPassword "secret1"
set success [CkCrypt2_AddPfxSourceBd $crypt $bdPfx $pfxPassword]
if {$success == 0} then {
    puts [CkCrypt2_lastErrorText $crypt]
    delete_CkCrypt2 $crypt
    delete_CkBinData $bdPfx
    exit
}

# Add as many as PFX sources as desired...
set success [CkBinData_LoadFile $bdPfx "c:/my_pfx_files/b.pfx"]
set pfxPassword "secret2"
set success [CkCrypt2_AddPfxSourceBd $crypt $bdPfx $pfxPassword]
if {$success == 0} then {
    puts [CkCrypt2_lastErrorText $crypt]
    delete_CkCrypt2 $crypt
    delete_CkBinData $bdPfx
    exit
}

# ...
# ...

delete_CkCrypt2 $crypt
delete_CkBinData $bdPfx