Sample code for 30+ languages & platforms
Ruby

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

crypt = Chilkat::CkCrypt2.new()
success = false

# Do public-key decryption (RSA)
crypt.put_CryptAlgorithm("pki")

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

bdPfx = Chilkat::CkBinData.new()
success = bdPfx.LoadFile("c:/my_pfx_files/a.pfx")
# ...

pfxPassword = "secret1"
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword)
if (success == false)
    print crypt.lastErrorText() + "\n";
    exit
end

# Add as many as PFX sources as desired...
success = bdPfx.LoadFile("c:/my_pfx_files/b.pfx")
pfxPassword = "secret2"
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword)
if (success == false)
    print crypt.lastErrorText() + "\n";
    exit
end

# ...
# ...