AlgorithmChecker
in package
implements
HeaderChecker
FinalYes
This class is a header parameter checker.
When the "alg" header parameter is present, it will check if the value is within the allowed ones.
Table of Contents
Interfaces
Constants
- HEADER_NAME = 'alg'
Properties
- $protectedHeader : bool
- $supportedAlgorithms : array<string|int, string>
Methods
- __construct() : mixed
- checkHeader() : void
- This method is called when the header parameter is present.
- protectedHeaderOnly() : bool
- When true, the header parameter to be checked MUST be set in the protected header of the token.
- supportedHeader() : string
- The method returns the header parameter to be checked.
Constants
HEADER_NAME
private
mixed
HEADER_NAME
= 'alg'
Properties
$protectedHeader
private
bool
$protectedHeader
= false
$supportedAlgorithms
private
array<string|int, string>
$supportedAlgorithms
Methods
__construct()
public
__construct(array<string|int, string> $supportedAlgorithms[, bool $protectedHeader = false ]) : mixed
Parameters
- $supportedAlgorithms : array<string|int, string>
- $protectedHeader : bool = false
checkHeader()
This method is called when the header parameter is present.
public
checkHeader(mixed $value) : void
Parameters
- $value : mixed
protectedHeaderOnly()
When true, the header parameter to be checked MUST be set in the protected header of the token.
public
protectedHeaderOnly() : bool
Return values
boolsupportedHeader()
The method returns the header parameter to be checked.
public
supportedHeader() : string