| 1 | <?php declare(strict_types = 1); |
||
| 14 | class HmacValidator implements SignatureValidator |
||
| 15 | { |
||
| 16 | const SHA256 = 'sha256'; |
||
| 17 | const SHA512 = 'sha512'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $hashAlgorithm; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param string $hashAlgorithm |
||
| 26 | */ |
||
| 27 | public function __construct($hashAlgorithm = self::SHA256) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $payload |
||
| 34 | * @param string $secret |
||
| 35 | * @param string $signature |
||
| 36 | * |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function isValid($payload, $secret, $signature) |
||
| 43 | } |
||
| 44 |