Additional Authentication Data (AAD)

The Additional Authenticated Data (AAD) is an input to an Authenticated Encryption operation. The AAD is integrity protected but not encrypted.

Its value can be any string you want that is needed by your application. With the example below, we will add a dummy AAD:

$jwe = $jweBuilder
        'enc' => 'A256CBC-HS512',
        'alg' => 'RSA-OAEP-256',
        //'zip' => 'DEF',

Note: when the AAD is set, the Compact Serialization mode is not available.

Last updated