‘RSA’,
‘n’ => $n,
‘e’ => $e,
‘d’ => $d
]);
$recipientHeader = [
‘enc’ => ‘A256GCM’,
‘alg’ => ‘RSA-OAEP-256’
];
$payload = [
“Data” => [
“wstoken” => “b455d8373bfde040749065a4728f2d2b”,
“wsfunction” => “mobile_webservices_get_mynotifications”,
“moodlewsrestformat” => “json”
],
“Risk” => []
];
$jsonPayload = json_encode($payload);
// Sign the data using the private key
openssl_sign($jsonPayload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
$signedPayloadRS256 = base64_encode($signature);
$jwe = $jweBuilder->create()
->withPayload($signedPayloadRS256)
->addRecipient($recipientKey, $recipientHeader)
//->withSharedProtectedHeader([])
->build();
echo $jweToken = $JWEserializer->serialize($jwe);
?>
what do you think about is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2