Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
keys = $keys;
}
public static function new(array $keys)
{
return new JwksEndpoint($keys);
}
public static function fromIssuer(IDatabase $database, $issuer)
{
$registration = $database->findRegistrationByIssuer($issuer);
return new JwksEndpoint([$registration->getKid() => $registration->getToolPrivateKey()]);
}
public static function fromRegistration(ILtiRegistration $registration)
{
return new JwksEndpoint([$registration->getKid() => $registration->getToolPrivateKey()]);
}
public function getPublicJwks()
{
$jwks = [];
foreach ($this->keys as $kid => $private_key) {
$key_res = openssl_pkey_get_private($private_key);
$key_details = openssl_pkey_get_details($key_res);
$components = [
'kty' => 'RSA',
'alg' => 'RS256',
'use' => 'sig',
'e' => JWT::urlsafeB64Encode($key_details['rsa']['e']),
'n' => JWT::urlsafeB64Encode($key_details['rsa']['n']),
'kid' => $kid,
];
$jwks[] = $components;
}
return ['keys' => $jwks];
}
public function outputJwks()
{
echo json_encode($this->getPublicJwks());
}
}