Sample code for 30+ languages & platforms
PowerBuilder

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Crypt
oleobject loo_BdPfx
string ls_PfxPassword

li_Success = 0

loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")
if li_rc < 0 then
    destroy loo_Crypt
    MessageBox("Error","Connecting to COM object failed")
    return
end if
li_Success = 0

// Do public-key decryption (RSA)
loo_Crypt.CryptAlgorithm = "pki"

// ...
// ...
// ...

loo_BdPfx = create oleobject
li_rc = loo_BdPfx.ConnectToNewObject("Chilkat.BinData")

li_Success = loo_BdPfx.LoadFile("c:/my_pfx_files/a.pfx")
// ...

ls_PfxPassword = "secret1"
li_Success = loo_Crypt.AddPfxSourceBd(loo_BdPfx,ls_PfxPassword)
if li_Success = 0 then
    Write-Debug loo_Crypt.LastErrorText
    destroy loo_Crypt
    destroy loo_BdPfx
    return
end if

// Add as many as PFX sources as desired...
li_Success = loo_BdPfx.LoadFile("c:/my_pfx_files/b.pfx")
ls_PfxPassword = "secret2"
li_Success = loo_Crypt.AddPfxSourceBd(loo_BdPfx,ls_PfxPassword)
if li_Success = 0 then
    Write-Debug loo_Crypt.LastErrorText
    destroy loo_Crypt
    destroy loo_BdPfx
    return
end if

// ...
// ...


destroy loo_Crypt
destroy loo_BdPfx