Sample code for 30+ languages & platforms
Unicode C++

Transition from Cert.GetCertChain to Cert.BuildCertChain

Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkCertW.h>
#include <CkCertChainW.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkCertW cert;

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

    CkCertChainW *certchainObj = cert.GetCertChain();
    if (cert.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",cert.lastErrorText());
        return;
    }

    //  ...
    //  ...

    delete certchainObj;

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

    CkCertChainW certchainOut;
    success = cert.BuildCertChain(certchainOut);
    if (success == false) {
        wprintf(L"%s\n",cert.lastErrorText());
        return;
    }
    }