Master Key Encryption failed #38
Description
Hello,
when i use the library to create a jwe string with an symetric AES key, i get an error:
Fatal error: Uncaught exception 'JOSE_Exception_EncryptionFailed' with message 'Master key encryption failed' in C:\xampp\htdocs\jwe\src\JOSE\JWE.php:170 Stack trace: #0 C:\xampp\htdocs\jwe\src\JOSE\JWE.php(39): JOSE_JWE->encryptContentEncryptionKey('xxxxx...') #1 C:\xampp\htdocs\jwe\app\jwe-test.php(26): JOSE_JWE->encrypt('xxxx...') #2 {main} thrown in C:\xampp\htdocs\jwe\src\JOSE\JWE.php on line 170
Here is the way i use the library:
`require dirname(FILE) . '/../vendor/autoload.php';
require("inc_idp.conf");
$username = "";
$passwd = "";
$plain_text = array(
'type' => 'login_silent',
'timestamp' => mktime(date('H'), date('i'), date('s'), date('m'), date('d'), date('Y')),
'username' => $username,
'password' => $passwd,
'redirect' => 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],
'claims' => ['id','first_name','last_name','email']
);
$jwe = new JOSE_JWE($plain_text);
$jwe->encrypt($client_secret, 'RSA-OAEP','A256GCM');
echo $jwe->toString();`
Do you know whats wrong with the key? Or is this key type not supported?
Regards
Dave
Activity