mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-04 20:23:16 +00:00
32 lines
573 B
PHP
32 lines
573 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Util\HttpSignatures;
|
||
|
|
||
|
use Psr\Http\Message\RequestInterface;
|
||
|
|
||
|
class Verifier
|
||
|
{
|
||
|
/** @var KeyStoreInterface */
|
||
|
private $keyStore;
|
||
|
|
||
|
/**
|
||
|
* @param KeyStoreInterface $keyStore
|
||
|
*/
|
||
|
public function __construct(KeyStoreInterface $keyStore)
|
||
|
{
|
||
|
$this->keyStore = $keyStore;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param RequestInterface $message
|
||
|
*
|
||
|
* @return bool
|
||
|
*/
|
||
|
public function isValid($message)
|
||
|
{
|
||
|
$verification = new Verification($message, $this->keyStore);
|
||
|
|
||
|
return $verification->isValid();
|
||
|
}
|
||
|
}
|