\CyberSource\Api\KeyGenerationApi::generatePublicKey() will fail if masking is enabled.
The code fails in cybersource/rest-client-php/lib/Api/KeyGenerationApi.php, line 172 because $httpBody is an array and \CyberSource\Utilities\Helpers\DataMasker::maskData expects to be passed a JSON string. Something gets lost along the way if you call generatePublicKey() with a bare array.