LTI Integration Library  3.1.0
PHP class library for building LTI integrations
OAuthSignatureMethod_HMAC_SHA384.php
Go to the documentation of this file.
1 <?php
2 
3 namespace ceLTIc\LTI\OAuth;
4 
21 {
22 
23  function get_name()
24  {
25  return "HMAC-SHA384";
26  }
27 
28  public function build_signature($request, $consumer, $token)
29  {
30  $base_string = $request->get_signature_base_string();
31  $request->base_string = $base_string;
32 
33  $key_parts = array(
34  $consumer->secret,
35  ($token) ? $token->secret : ""
36  );
37 
38  $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
39  $key = implode('&', $key_parts);
40 
41  return base64_encode(hash_hmac('sha384', $base_string, $key, true));
42  }
43 
44 }
Class to represent an OAuth Signature Method.
static urlencode_rfc3986($input)
Definition: OAuthUtil.php:15
Class to represent an OAuth HMAC_SHA384 signature method.