Sample code for 30+ languages & platforms
Swift

Example: Crypt2.AddPfxSourceFile method

Demonstrates how to call the AddPfxSourceFile method.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let crypt = CkoCrypt2()!
    success = false

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

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

    var pfxPath: String? = "c:/my_pfx_files/a.pfx"
    var pfxPassword: String? = "secret1"
    success = crypt.addPfxSourceFile(pfxFilePath: pfxPath, password: pfxPassword)
    if success == false {
        print("\(crypt.lastErrorText!)")
        return
    }

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

    // ...
    // ...

}