1 | <?php |
||
12 | class Signer |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $secret; |
||
18 | |||
19 | /** |
||
20 | * @var HashCalculator |
||
21 | */ |
||
22 | private $calculator; |
||
23 | |||
24 | /** |
||
25 | * @var NonceProvider |
||
26 | */ |
||
27 | private $nonceProvider; |
||
28 | |||
29 | /** |
||
30 | * @var TimeProvider |
||
31 | */ |
||
32 | private $timeProvider; |
||
33 | |||
34 | /** |
||
35 | * @param string $secret |
||
36 | */ |
||
37 | 91 | public function __construct($secret) |
|
44 | |||
45 | /** |
||
46 | * @param MessageInterface $message |
||
47 | * |
||
48 | * @return MessageInterface The signed message. |
||
49 | * |
||
50 | * @throws \InvalidArgumentException When $message is an implementation of |
||
51 | * MessageInterface that cannot be |
||
52 | * serialized and thus neither signed. |
||
53 | */ |
||
54 | 91 | public function sign(MessageInterface $message) |
|
69 | |||
70 | /** |
||
71 | * @param MessageInterface $message |
||
72 | * |
||
73 | * @return MessageInterface |
||
74 | */ |
||
75 | 91 | private function withSignedHeadersHeader(MessageInterface $message) |
|
93 | } |
||
94 |