Sample code for 30+ languages & platforms
PowerBuilder

Demonstrates how to call AddPfxSourceData for an Email Object

Demonstrates how to call AddPfxSourceData for an Email Object

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
long li_Success
oleobject loo_Fac
oleobject loo_Email

li_Success = 0

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

loo_PfxBytes = loo_Fac.ReadEntireFile("qa_data/pfx/some.pfx")

loo_Email = create oleobject
li_rc = loo_Email.ConnectToNewObject("Chilkat.Email")

li_Success = loo_Email.AddPfxSourceData(loo_PfxBytes,"PFX_PASSWORD")
if li_Success <> 1 then
    Write-Debug loo_Email.LastErrorText
    destroy loo_Fac
    destroy loo_Email
    return
end if

Write-Debug "Success."


destroy loo_Fac
destroy loo_Email