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

Transition from Cert.GetCertChain to Cert.BuildCertChain

Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.

Chilkat C++ Downloads

C++
#include <CkCert.h>
#include <CkCertChain.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkCert cert;

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

    CkCertChain *certchainObj = cert.GetCertChain();
    if (cert.get_LastMethodSuccess() == false) {
        std::cout << cert.lastErrorText() << "\r\n";
        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.

    CkCertChain certchainOut;
    success = cert.BuildCertChain(certchainOut);
    if (success == false) {
        std::cout << cert.lastErrorText() << "\r\n";
        return;
    }
    }