Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Master Key Encryption failed #38

Open
bwwdavidberg opened this issue Jul 20, 2017 · 0 comments
Open

Master Key Encryption failed #38

bwwdavidberg opened this issue Jul 20, 2017 · 0 comments

Comments

@bwwdavidberg
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant