(Unicode C++) Example: Crypt2.AddPfxSourceBd method
Demonstrates how to call the AddPfxSourceBd method.
#include <CkCrypt2W.h>
#include <CkBinDataW.h>
void ChilkatSample(void)
{
CkCrypt2W crypt;
bool success = false;
// Do public-key decryption (RSA)
crypt.put_CryptAlgorithm(L"pki");
// ...
// ...
// ...
CkBinDataW bdPfx;
success = bdPfx.LoadFile(L"c:/my_pfx_files/a.pfx");
// ...
const wchar_t *pfxPassword = L"secret1";
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword);
if (success == false) {
wprintf(L"%s\n",crypt.lastErrorText());
return;
}
// Add as many as PFX sources as desired...
success = bdPfx.LoadFile(L"c:/my_pfx_files/b.pfx");
pfxPassword = L"secret2";
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword);
if (success == false) {
wprintf(L"%s\n",crypt.lastErrorText());
return;
}
// ...
// ...
}
|