1 | <?php |
||
12 | class Verifier |
||
13 | { |
||
14 | /** |
||
15 | * @var HashCalculator |
||
16 | */ |
||
17 | private $calculator; |
||
18 | |||
19 | /** |
||
20 | * @var MonitorInterface |
||
21 | */ |
||
22 | private $monitor; |
||
23 | |||
24 | /** |
||
25 | * @var HeaderValidator |
||
26 | */ |
||
27 | private $validator; |
||
28 | |||
29 | 98 | public function __construct(MonitorInterface $monitor = null) |
|
39 | |||
40 | /** |
||
41 | * @param MessageInterface $message |
||
42 | * @param string $secret |
||
43 | * |
||
44 | * @return bool Signature verification outcome. |
||
45 | * |
||
46 | * @throws \InvalidArgumentException When $message is an implementation of |
||
47 | * MessageInterface that cannot be |
||
48 | * serialized and thus neither verified. |
||
49 | */ |
||
50 | 98 | public function verify(MessageInterface $message, $secret) |
|
63 | |||
64 | /** |
||
65 | * @param MessageInterface $message |
||
66 | * |
||
67 | * @return MessageInterface |
||
68 | */ |
||
69 | 77 | private function withoutUnsignedHeaders(MessageInterface $message) |
|
81 | } |
||
82 |