You are here

function services_validate_key in Services 6

Same name and namespace in other branches
  1. 5 services.module \services_validate_key()
1 call to services_validate_key()
services_method_call in ./services.module
This is the magic function through which all remote method calls must pass.

File

./services.module, line 475
@author Services Dev Team

Code

function services_validate_key($kid, $timestamp, $domain, $nonce, $method_name, $hash_parameters, $hash) {
  $hash_parameters = array_merge(array(
    $timestamp,
    $domain,
    $nonce,
    $method_name,
  ), $hash_parameters);
  $rehash = hash_hmac("sha256", implode(';', $hash_parameters), $kid);
  return $rehash == $hash ? TRUE : FALSE;
}