1 | <?php |
||
10 | class Verifier |
||
11 | { |
||
12 | /** |
||
13 | * @var HashCalculator |
||
14 | */ |
||
15 | private $calculator; |
||
16 | |||
17 | /** |
||
18 | * @var null|int |
||
19 | */ |
||
20 | private $maxDelay = null; |
||
21 | |||
22 | /** |
||
23 | * @var HeaderValidator |
||
24 | */ |
||
25 | private $validator; |
||
26 | |||
27 | 92 | public function __construct() |
|
34 | |||
35 | /** |
||
36 | * @param int $maxDelay |
||
37 | * |
||
38 | * @return Verifier |
||
39 | */ |
||
40 | 1 | public function setMaximumDelay($maxDelay) |
|
46 | |||
47 | /** |
||
48 | * @param MessageInterface $message |
||
49 | * @param string $secret |
||
50 | * |
||
51 | * @return bool Signature verification outcome. |
||
52 | * |
||
53 | * @throws \InvalidArgumentException When $message is an implementation of |
||
54 | * MessageInterface that cannot be |
||
55 | * serialized and thus neither verified. |
||
56 | */ |
||
57 | 92 | public function verify(MessageInterface $message, $secret) |
|
74 | |||
75 | /** |
||
76 | * @param MessageInterface $message |
||
77 | * |
||
78 | * @return MessageInterface |
||
79 | */ |
||
80 | 71 | private function withoutUnsignedHeaders(MessageInterface $message) |
|
92 | |||
93 | /** |
||
94 | * @param MessageInterface $message |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | 71 | private function delayed(MessageInterface $message) |
|
105 | } |
||
106 |