You are here

function services_validate_key in Services 5

Same name and namespace in other branches
  1. 6 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 550
The module which provides the core code for drupal services

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;
}