Sample code for 30+ languages & platforms
Swift

Demonstrates how to call AddPfxSourceData for an Email Object

Demonstrates how to call AddPfxSourceData for an Email Object

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let fac = CkoFileAccess()!
    var pfxBytes: NSData
    pfxBytes = fac.readEntireFile(path: "qa_data/pfx/some.pfx")

    let email = CkoEmail()!

    success = email.addPfxSourceData(pfxData: pfxBytes, password: "PFX_PASSWORD")
    if success != true {
        print("\(email.lastErrorText!)")
        return
    }

    print("Success.")

}