Sample code for 30+ languages & platforms
Swift

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let crypt = CkoCrypt2()!
    success = false

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

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

    let bdPfx = CkoBinData()!
    success = bdPfx.loadFile(path: "c:/my_pfx_files/a.pfx")
    // ...

    var pfxPassword: String? = "secret1"
    success = crypt.addPfxSourceBd(bd: bdPfx, password: pfxPassword)
    if success == false {
        print("\(crypt.lastErrorText!)")
        return
    }

    // Add as many as PFX sources as desired...
    success = bdPfx.loadFile(path: "c:/my_pfx_files/b.pfx")
    pfxPassword = "secret2"
    success = crypt.addPfxSourceBd(bd: bdPfx, password: pfxPassword)
    if success == false {
        print("\(crypt.lastErrorText!)")
        return
    }

    // ...
    // ...

}