1 | <?php |
||
4 | class Auth |
||
5 | { |
||
6 | /** @var string */ |
||
7 | protected $secretAcessKey; |
||
8 | |||
9 | /** @var string */ |
||
10 | protected $accessKey; |
||
11 | |||
12 | /** @var int */ |
||
13 | protected $currentTime; |
||
14 | |||
15 | 3 | public function __construct($secretAcessKey, $accessKey, $currentTime = null) |
|
21 | |||
22 | /** |
||
23 | * @param string $methodName Method name |
||
24 | * @param array $data Method payload |
||
25 | * @return array Send ready request payload |
||
26 | */ |
||
27 | 3 | public function preparePayload($methodName, array $data) |
|
57 | |||
58 | /** |
||
59 | * Based on code from api.wiziq.com |
||
60 | * |
||
61 | * @param string $data |
||
62 | * @param int $blocksize |
||
63 | * @return string |
||
64 | */ |
||
65 | 3 | protected function hmacsha1($data, $blocksize = 64) |
|
78 | } |
||
79 |