Sample code for 30+ languages & platforms
Swift Requires Chilkat v11.0.0+

Transition from Cert.GetCertChain to Cert.BuildCertChain

Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.

Chilkat Swift Downloads

Swift

func chilkatTest() {
    var success: Bool = false

    let cert = CkoCert()!

    //  ------------------------------------------------------------------------
    //  The GetCertChain method is deprecated:

    var certchainObj: CkoCertChain? = cert.getChain()
    if cert.lastMethodSuccess == false {
        print("\(cert.lastErrorText!)")
        return
    }

    //  ...
    //  ...

    certchainObj = nil

    //  ------------------------------------------------------------------------
    //  Do the equivalent using BuildCertChain.
    //  Your application creates a new, empty CertChain object which is passed 
    //  in the last argument and filled upon success.

    let certchainOut = CkoCertChain()!
    success = cert.buildChain(certChain: certchainOut)
    if success == false {
        print("\(cert.lastErrorText!)")
        return
    }


}