Amazon CloudFront:修订间差异
跳到导航
跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
(→外部連結) |
无编辑摘要 |
||
第1行: | 第1行: | ||
'''Amazon CloudFront'''是[[AWS]]所推出的[[CDN]]服務。 | |||
== 範例 == | == 範例 == | ||
=== signing === | === signing === |
2018年2月5日 (一) 13:27的版本
Amazon CloudFront是AWS所推出的CDN服务。
范例
signing
<?php $key_pair_id = 'APKA...'; $pem_file = ''; $resource = 'http://test2-cdn.gslin.org/test.txt'; $expires = time() + 3600; $json_str = json_encode( array( 'Statement' => array( array( 'Resource' => $resource, 'Condition' => array( 'DateLessThan' => array( 'AWS:EpochTime' => $expires ) ) ) ) ), JSON_UNESCAPED_SLASHES ); $buf = file_get_contents($pem_file); $key = openssl_get_privatekey($buf); openssl_sign($json_str, $signed_policy, $key, OPENSSL_ALGO_SHA1); openssl_free_key($key); $signature = str_replace( array('+', '=', '/'), array('-', '_', '~'), base64_encode($signed_policy) ); echo "${resource}?", "Expires=${expires}&", "Signature=${signature}&", "Key-Pair-Id=${key_pair_id}\n";
外部链接
- 官方网站 (英文)