Sample code for 30+ languages & platforms
C++

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat C++ Downloads

C++
#include <CkCrypt2.h>
#include <CkBinData.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkCrypt2 crypt;
    success = false;

    //  Do public-key decryption (RSA)
    crypt.put_CryptAlgorithm("pki");

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

    CkBinData bdPfx;
    success = bdPfx.LoadFile("c:/my_pfx_files/a.pfx");
    //  ...

    const char *pfxPassword = "secret1";
    success = crypt.AddPfxSourceBd(bdPfx,pfxPassword);
    if (success == false) {
        std::cout << crypt.lastErrorText() << "\r\n";
        return;
    }

    //  Add as many as PFX sources as desired...
    success = bdPfx.LoadFile("c:/my_pfx_files/b.pfx");
    pfxPassword = "secret2";
    success = crypt.AddPfxSourceBd(bdPfx,pfxPassword);
    if (success == false) {
        std::cout << crypt.lastErrorText() << "\r\n";
        return;
    }

    //  ...
    //  ...
    }