このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 02 Apache2で自己認証ssl [中間証明書の整合性確認]
最近の更新
※signature生成時の注意点
<?php $api_key = 039;API キー039;; $sak = 039;秘密鍵039;; $command = 039;listVirtualMachines039;; $url = 039;https://hogehoge.com/client/api?039;; $params = array( 039;response039; => 039;json039;, 039;command039; => $command, 039;apikey039; => $api_key, ); $query_str = 039;039;; ksort($params); foreach($params as $k => $v){ $query_str .= urlencode($k) . "=" . rawurlencode($v) . "&"; } $query_str = rtrim($query_str, "&"); #echo strtolower($query_str)."\n"; $sig = base64_encode(hash_hmac ( 039;sha1039; , strtolower($query_str), $sak, true)); $final = $url . $query_str . "&signature=" . urlencode($sig); echo "API URL: $final \n"; ?>