1 | <?php |
||
9 | class Signature { |
||
10 | /** |
||
11 | * 获取分块上传接口的签名 |
||
12 | */ |
||
13 | const SIGN_MULTIPART = 1; |
||
14 | /** |
||
15 | * 生成视频处理接口的签名 |
||
16 | */ |
||
17 | const SIGN_VIDEO = 2; |
||
18 | /** |
||
19 | * 生成视频处理接口的签名(不需要操作员时使用) |
||
20 | */ |
||
21 | const SIGN_VIDEO_NO_OPERATOR = 3; |
||
22 | |||
23 | /** |
||
24 | * 获取 Header 签名 |
||
25 | * |
||
26 | * @param Config $bucketConfig |
||
27 | * @param $method |
||
28 | * @param $path 请求路径 |
||
29 | * @param $contentMd5 文件内容 md5 |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | public static function getHeaderSign($bucketConfig, $method, $path, $contentMd5 = null) { |
||
55 | |||
56 | /** |
||
57 | * 获取请求缓存刷新接口需要的签名头 |
||
58 | * |
||
59 | * @param Config $bucketConfig |
||
60 | * @param $urlString |
||
61 | * |
||
62 | * @return array |
||
63 | */ |
||
64 | public static function getPurgeSignHeader(Config $bucketConfig, $urlString) { |
||
73 | |||
74 | /** |
||
75 | * 获取表单 API 需要的签名,依据 body 签名规则计算 |
||
76 | * @param Config $bucketConfig |
||
77 | * @param $data |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | public static function getFormSignature(Config $bucketConfig, $data) { |
||
103 | |||
104 | private static function calcSignature(Config $bucketConfig, $signParams) { |
||
107 | |||
108 | public static function getSignature(Config $bucketConfig, $data, $type, $tokenSecret = '') { |
||
133 | } |
||
134 |