An error occurred while loading the file. Please try again.
-
Michelle Noorali authored
This feature allows you to rollback release to the previous version of release. resolves #1004
ac88aaf2
<?php
require __DIR__ . '/vendor/autoload.php';
use \Firebase\JWT\JWT;
class FirebaseRS256 {
function __construct() {
$this->private_key = file_get_contents('private.pem');
$this->public_key = file_get_contents('public.pem');
}
function encodeJwt($tokenObj) {
return JWT::encode($tokenObj, $this->private_key, 'RS256');
}
function decodeJwt($token) {
// Explicitly configured to be vulnerable:
// we expect a RS256 signature, but also accept a HS256 signature.
return JWT::decode($token, $this->public_key, ['RS256', 'HS256']);
}
}