Sample code for 30+ languages & platforms
Lua

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

local crypt = chilkat.Crypt2.new()
local success = false

-- Do public-key decryption (RSA)
crypt.crypt_algorithm = "pki"

-- ...
-- ...
-- ...

local bdPfx = chilkat.BinData.new()
success = bdPfx:load_file("c:/my_pfx_files/a.pfx")
-- ...

local pfxPassword = "secret1"
success = crypt:add_pfx_source_bd(bdPfx, pfxPassword)
if not success then
    print(crypt.last_error_text)
    return
end

-- Add as many as PFX sources as desired...
success = bdPfx:load_file("c:/my_pfx_files/b.pfx")
pfxPassword = "secret2"
success = crypt:add_pfx_source_bd(bdPfx, pfxPassword)
if not success then
    print(crypt.last_error_text)
    return
end

-- ...
-- ...