Encrypted Tokens (JWE)
Encryted Tokens Creation
<?php
use Jose\Factory\JWEFactory;
use Jose\Factory\JWKFactory;
// We want to encrypt a very important message
$message = 'Today, 8:00PM, train station.';
$jwe = JWEFactory::createJWEToCompactJSON(
$message, // The message to encrypt
$key, // The key of the recipient
[ // The shared protected header
'alg' => 'RSA-OAEP-256',
'enc' => 'A256CBC-HS512',
'zip' => 'DEF',
]
);Tokens Decryption
Last updated
Was this helpful?