(C++) Workaround for the deprecated Crypt2.SetMacKeyBytes method
Shows how to replace the deprecated SetMacKeyBytes method. (Chilkat is moving away from the use of CkByteData.) Note: This example requires Chilkat v11.0.0 or greater.
#include <CkCrypt2.h>
#include <CkByteData.h>
#include <CkBinData.h>
void ChilkatSample(void)
{
CkCrypt2 crypt;
// ------------------------------------------------------------------------
// The SetMacKeyBytes method is deprecated:
CkByteData keyBytes;
// ...
// ...
bool success = crypt.SetMacKeyBytes(keyBytes);
// ------------------------------------------------------------------------
// Workaround.
// (Chilkat is moving away from using CkByteData)
CkBinData bdKey;
// ...
// ...
const char *encoding = "base64";
const char *base64_mackey = bdKey.getEncoded(encoding);
success = crypt.SetMacKeyEncoded(base64_mackey,encoding);
}
|