Data Protection
Ecotone enables protection for data sent outside of the application (e.g. using RabbitMQ) by obfuscating messages' payload and headers.
Installation
composer require ecotone/data-protectionConfiguration
use Defuse\Crypto\Key;
use Ecotone\DataProtection\Configuration\DataProtectionConfiguration;
class DataProtection
{
#[ServiceContext]
public function dataProtectionConfiguration(): DataProtectionConfiguration
{
return DataProtectionConfiguration::create(name: 'primary-key', key: Key::loadFromAsciiSafeString(...)) // first key will be set as default
->withKey(name: 'secondary-key', key: Key::loadFromAsciiSafeString(...))
->withKey(name: 'default-key', key: Key::loadFromAsciiSafeString(...), asDefault: true) // overwrite default key passing `asDefault: true`
;
}
}Obfuscate Channel
Obfuscate Message
Obfuscate Endpoint
Last updated
Was this helpful?