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

Workaround for the deprecated Crypt2.SetMacKeyBytes method

Shows how to replace the deprecated SetMacKeyBytes method. (Chilkat is moving away from the use of CkByteData.)

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$crypt = new CkCrypt2();

//  ------------------------------------------------------------------------
//  The SetMacKeyBytes method is deprecated:

$keyBytes = new CkByteData();
//  ...
//  ...

$success = $crypt->SetMacKeyBytes($keyBytes);

//  ------------------------------------------------------------------------
//  Workaround.
//  (Chilkat is moving away from using CkByteData)

$bdKey = new CkBinData();
//  ...
//  ...

$encoding = 'base64';
$base64_mackey = $bdKey->getEncoded($encoding);

$success = $crypt->SetMacKeyEncoded($base64_mackey,$encoding);

?>