ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
OAuthSignatureMethod_HMAC_SHA256.php
Go to the documentation of this file.
1 <?php
2 
3 namespace IMSGlobal\LTI\OAuth;
4 
21 
22  function get_name() {
23  return "HMAC-SHA256";
24  }
25 
26  public function build_signature($request, $consumer, $token) {
27 
28  $base_string = $request->get_signature_base_string();
29  $request->base_string = $base_string;
30 
31  $key_parts = array(
32  $consumer->secret,
33  ($token) ? $token->secret : ""
34  );
35 
36  $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
37  $key = implode('&', $key_parts);
38 
39  return base64_encode(hash_hmac('sha256', $base_string, $key, true));
40 
41  }
42 
43 }
static urlencode_rfc3986($input)
Definition: OAuthUtil.php:14
Class to represent an OAuth Signature Method.
$consumer
Definition: demo.php:30
Create styles array
The data for the language used.
Class to represent an OAuth HMAC_SHA256 signature method.
$key
Definition: croninfo.php:18