Files
drmaterac.pl/modules/pshowsso/vendor/patrickbussmann/oauth2-apple/test/ext/KeyDumpSigner5.php
2025-11-20 16:34:30 +01:00

30 lines
552 B
PHP

<?php
namespace League\OAuth2\Client\Test;
use Lcobucci\JWT\Signature;
use Lcobucci\JWT\Signer;
final class KeyDumpSigner implements Signer
{
public function getAlgorithmId()
{
return 'keydump';
}
public function modifyHeader(array &$headers)
{
$headers['alg'] = $this->getAlgorithmId();
}
public function verify($expected, $payload, $key)
{
return $expected === $key->contents();
}
public function sign($payload, $key)
{
return new Signature($key->contents());
}
}