1 | <?php |
||
5 | abstract class Hmac implements SymmetricInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $secret; |
||
11 | |||
12 | /** |
||
13 | * @param string $secret |
||
14 | */ |
||
15 | public function __construct($secret) |
||
21 | |||
22 | /** |
||
23 | * @throws \RuntimeException |
||
24 | */ |
||
25 | private function ensureSupport() |
||
36 | |||
37 | /** |
||
38 | * @return array |
||
39 | */ |
||
40 | protected function getSupportedAlgorithms() |
||
44 | |||
45 | /** |
||
46 | * @param string $value |
||
47 | * @return string |
||
48 | */ |
||
49 | public function compute($value) |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | abstract protected function getAlgorithm(); |
||
58 | } |
||
59 |