1 | <?php |
||
9 | class Signer |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $secret; |
||
15 | |||
16 | /** |
||
17 | * @var Calculator |
||
18 | */ |
||
19 | private $calculator; |
||
20 | |||
21 | /** |
||
22 | * @param string $secret |
||
23 | */ |
||
24 | 72 | public function __construct($secret) |
|
29 | |||
30 | /** |
||
31 | * @param MessageInterface $message |
||
32 | * |
||
33 | * @return MessageInterface The signed message. |
||
34 | * |
||
35 | * @throws \InvalidArgumentException When $message is an implementation of |
||
36 | * MessageInterface that cannot be |
||
37 | * serialized and thus neither signed. |
||
38 | */ |
||
39 | 70 | public function sign(MessageInterface $message) |
|
50 | |||
51 | /** |
||
52 | * @param MessageInterface $message |
||
53 | * |
||
54 | * @return MessageInterface |
||
55 | */ |
||
56 | 70 | private function withSignedHeadersHeader(MessageInterface $message) |
|
74 | } |
||
75 |