| 1 | <?php |
||
| 19 | final class AlgorithmChecker implements HeaderCheckerInterface |
||
| 20 | { |
||
| 21 | private const HEADER_NAME = 'alg'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var bool |
||
| 25 | */ |
||
| 26 | private $protectedHeader = false; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string[] |
||
| 30 | */ |
||
| 31 | private $supportedAlgorithms; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * AudienceChecker constructor. |
||
| 35 | * |
||
| 36 | * @param string[] $supportedAlgorithms |
||
| 37 | * @param bool $protectedHeader |
||
| 38 | */ |
||
| 39 | public function __construct(array $supportedAlgorithms, bool $protectedHeader = false) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | */ |
||
| 48 | public function checkHeader($value) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | public function supportedHeader(): string |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | public function protectedHeaderOnly(): bool |
||
| 70 | } |
||
| 71 |