26 lines
632 B
PHP
26 lines
632 B
PHP
<?php
|
|
|
|
namespace Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Test;
|
|
|
|
use Pshowsso\Scope68f5e85e9608b\Lcobucci\JWT\Signature;
|
|
use Pshowsso\Scope68f5e85e9608b\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());
|
|
}
|
|
}
|