1 | <?php |
||
8 | class Signature |
||
9 | { |
||
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 $serviceConfig |
||
27 | * @param $method 请求方法 |
||
28 | * @param $path 请求路径 |
||
29 | * @param $contentMd5 文件内容 md5 |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | 21 | public static function getHeaderSign($serviceConfig, $method, $path, $contentMd5 = null) |
|
47 | |||
48 | /** |
||
49 | * 获取请求缓存刷新接口需要的签名头 |
||
50 | * |
||
51 | * @param Config $serviceConfig |
||
52 | * @param $urlString |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | 1 | public static function getPurgeSignHeader(Config $serviceConfig, $urlString) |
|
66 | |||
67 | /** |
||
68 | * 获取表单 API 需要的签名,依据 body 签名规则计算 |
||
69 | * @param Config $serviceConfig |
||
70 | * @param $method 请求方法 |
||
71 | * @param $uri 请求路径 |
||
72 | * @param $date 请求时间 |
||
73 | * @param $policy |
||
74 | * @param $contentMd5 请求 body 的 md5 |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 23 | public static function getBodySignature(Config $serviceConfig, $method, $uri, $date = null, $policy = null, $contentMd5 = null) |
|
98 | } |
||
99 |