ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
OAuthSignatureMethod_HMAC_SHA1.php
Go to the documentation of this file.
1 <?php
2 
3 namespace IMSGlobal\LTI\OAuth;
4 
20 
21  function get_name() {
22  return "HMAC-SHA1";
23  }
24 
25  public function build_signature($request, $consumer, $token) {
26 
27  $base_string = $request->get_signature_base_string();
28  $request->base_string = $base_string;
29 
30  $key_parts = array(
31  $consumer->secret,
32  ($token) ? $token->secret : ""
33  );
34 
35  $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
36  $key = implode('&', $key_parts);
37 
38  return base64_encode(hash_hmac('sha1', $base_string, $key, true));
39 
40  }
41 
42 }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static urlencode_rfc3986($input)
Definition: OAuthUtil.php:14
Class to represent an OAuth Signature Method.
$key
Definition: croninfo.php:18
Class to represent an OAuth HMAC_SHA1 signature method.