_openid_signature

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/openid/openid.inc, строка 223

Версии
6
_openid_signature($association, $message_array, $keys_to_sign)

Sign certain keys in a message

Параметры

$association - object loaded from openid_association or openid_server_association table

  • important fields are ->assoc_type and ->mac_key
$message_array - array of entire message about to be sent

$keys_to_sign - keys in the message to include in signature (without 'openid.' appended)

Код

<?php
function _openid_signature($association, $message_array, $keys_to_sign) {
  $signature = '';
  $sign_data = array();

  foreach ($keys_to_sign as $key) {
    if (isset($message_array['openid.'. $key])) {
      $sign_data[$key] = $message_array['openid.'. $key];
    }
  }

  $message = _openid_create_message($sign_data);
  $secret = base64_decode($association->mac_key);
  $signature = _openid_hmac($secret, $message);

  return base64_encode($signature);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему