ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
OAuthSignatureMethod_HMAC_SHA1 Class Reference

The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] where the Signature Base String is the text and the key is the concatenated values (each first encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' character (ASCII code 38) even if empty. More...

+ Inheritance diagram for OAuthSignatureMethod_HMAC_SHA1:
+ Collaboration diagram for OAuthSignatureMethod_HMAC_SHA1:

Public Member Functions

 get_name ()
 Needs to return the name of the Signature Method (ie HMAC-SHA1) More...
 
 build_signature ($request, $consumer, $token)
 Build up the signature NOTE: The output of this function MUST NOT be urlencoded. More...
 
- Public Member Functions inherited from OAuthSignatureMethod
 get_name ()
 Needs to return the name of the Signature Method (ie HMAC-SHA1) More...
 
 build_signature ($request, $consumer, $token)
 Build up the signature NOTE: The output of this function MUST NOT be urlencoded. More...
 
 check_signature ($request, $consumer, $token, $signature)
 Verifies that a given signature is correct. More...
 

Detailed Description

The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] where the Signature Base String is the text and the key is the concatenated values (each first encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' character (ASCII code 38) even if empty.

  • Chapter 9.2 ("HMAC-SHA1")

Definition at line 139 of file OAuth.php.

Member Function Documentation

◆ build_signature()

OAuthSignatureMethod_HMAC_SHA1::build_signature (   $request,
  $consumer,
  $token 
)

Build up the signature NOTE: The output of this function MUST NOT be urlencoded.

the encoding is handled in OAuthRequest when the final request is serialized

Parameters
OAuthRequest$request
OAuthConsumer$consumer
OAuthToken$token
Returns
string

Reimplemented from OAuthSignatureMethod.

Definition at line 146 of file OAuth.php.

147 {
148 $base_string = $request->get_signature_base_string();
149 $request->base_string = $base_string;
150
151 $key_parts = array(
152 $consumer->secret,
153 ($token) ? $token->secret : ""
154 );
155
156 $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
157 $key = implode('&', $key_parts);
158
159 return base64_encode(hash_hmac('sha1', $base_string, $key, true));
160 }
foreach($paths as $path) $request
Definition: asyncclient.php:32
static urlencode_rfc3986($input)
Definition: OAuth.php:827
$key
Definition: croninfo.php:18

References $key, $request, PHPMailer\PHPMailer\$token, and OAuthUtil\urlencode_rfc3986().

+ Here is the call graph for this function:

◆ get_name()

OAuthSignatureMethod_HMAC_SHA1::get_name ( )

Needs to return the name of the Signature Method (ie HMAC-SHA1)

Returns
string

Reimplemented from OAuthSignatureMethod.

Definition at line 141 of file OAuth.php.

142 {
143 return "HMAC-SHA1";
144 }

The documentation for this class was generated from the following file: