1 | <?php |
||
11 | class Signer |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $secret; |
||
17 | |||
18 | /** |
||
19 | * @var HashCalculator |
||
20 | */ |
||
21 | private $calculator; |
||
22 | |||
23 | /** |
||
24 | * @var TimeProvider |
||
25 | */ |
||
26 | private $timeProvider; |
||
27 | |||
28 | /** |
||
29 | * @param string $secret |
||
30 | */ |
||
31 | 91 | public function __construct($secret) |
|
37 | |||
38 | /** |
||
39 | * @param MessageInterface $message |
||
40 | * |
||
41 | * @return MessageInterface The signed message. |
||
42 | * |
||
43 | * @throws \InvalidArgumentException When $message is an implementation of |
||
44 | * MessageInterface that cannot be |
||
45 | * serialized and thus neither signed. |
||
46 | */ |
||
47 | 91 | public function sign(MessageInterface $message) |
|
58 | |||
59 | /** |
||
60 | * @param MessageInterface $message |
||
61 | * |
||
62 | * @return MessageInterface |
||
63 | */ |
||
64 | 91 | private function withSignedHeadersHeader(MessageInterface $message) |
|
82 | |||
83 | /** |
||
84 | * @param MessageInterface $message |
||
85 | * |
||
86 | * @return MessageInterface |
||
87 | */ |
||
88 | 91 | private function withDateHeader(MessageInterface $message) |
|
92 | } |
||
93 |