/** * createSignature * oauth 1.0a refference #9 * * parameters * url -- connection url * method -- 'GET', 'POST' or 'DELETE' * params -- request parameters oauth and post-field * * return * response of request */ protected function createSignature($url, $method, $params) { /* normalize */ ksort($params); $query = EDAssist::params2Query($params); /* collect key and base string */ $key = $this->consumer_secret . '&' . $this->oauth_token_secret; $base_string = $method . '&' . rawurlencode($url) . '&' . rawurlencode($query); $signature = rawurlencode(base64_encode(hash_hmac(EDAssist::$hash_algo, $base_string, $key, true))); return $signature; }