Skip to content

Commit

Permalink
use key interface for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ylebre committed Jan 17, 2024
1 parent 7c2af42 commit 3c8a9fa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Utils/Jwks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
namespace Pdsinterop\Solid\Auth\Utils;

use JsonSerializable;
use Lcobucci\JWT\Signer\Key\InMemory;
use Lcobucci\JWT\Signer\Key as Key;
use Pdsinterop\Solid\Auth\Enum\Jwk\Parameter as JwkParameter;
use Pdsinterop\Solid\Auth\Enum\Rsa\Parameter as RsaParameter;

class Jwks implements JsonSerializable
{
////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\

/** @var InMemory */
/** @var Key */
private $publicKey;

//////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

final public function __construct(InMemory $publicKey)
final public function __construct(Key $publicKey)
{
$this->publicKey = $publicKey;
}
Expand Down Expand Up @@ -64,9 +64,8 @@ private function create() : array

$publicKeys = [$this->publicKey];

array_walk($publicKeys, function (InMemory $publicKey) use (&$jwks) {
array_walk($publicKeys, function (Key $publicKey) use (&$jwks) {
$certificate = $publicKey->contents();

$key = openssl_pkey_get_public($certificate);
$keyInfo = openssl_pkey_get_details($key);

Expand Down

0 comments on commit 3c8a9fa

Please sign in to comment.