(Perl) 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.
use chilkat();
$crypt = chilkat::CkCrypt2->new();
# ------------------------------------------------------------------------
# The SetMacKeyBytes method is deprecated:
$keyBytes = chilkat::CkByteData->new();
# ...
# ...
$success = $crypt->SetMacKeyBytes($keyBytes);
# ------------------------------------------------------------------------
# Workaround.
# (Chilkat is moving away from using CkByteData)
$bdKey = chilkat::CkBinData->new();
# ...
# ...
$encoding = "base64";
$base64_mackey = $bdKey->getEncoded($encoding);
$success = $crypt->SetMacKeyEncoded($base64_mackey,$encoding);
|