ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
OAuthSignatureMethod_HMAC_SHA1.php
Go to the documentation of this file.
1<?php
2
3namespace 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}
An exception for terminatinating execution or to throw for unit testing.
Class to represent an OAuth HMAC_SHA1 signature method.
build_signature($request, $consumer, $token)
Build up the signature NOTE: The output of this function MUST NOT be urlencoded.
get_name()
Needs to return the name of the Signature Method (ie HMAC-SHA1)
Class to represent an OAuth Signature Method.
static urlencode_rfc3986($input)
Definition: OAuthUtil.php:14
$key
Definition: croninfo.php:18
$consumer
Definition: demo.php:30