function sign_reply($reply, $key, $signed_fields) { // Sign the given fields from the reply with the specified key. // Return signed and sig $text = ''; foreach ($signed_fields as $i) { $val = $reply['openid.' . $i]; $text .= sprintf("%s:%s\n", $i, $val); } $sha1 = oidUtil::hmacsha1($key, $text); $b64_sha1 = oidUtil::to_b64($sha1); return array(implode(',', $signed_fields), $b64_sha1); }
function create_return_to($base, $identity) { $args = array('id' => $identity, 'time' => (string) time()); $args['v'] = oidUtil::to_b64(oidUtil::hmacsha1($this->secret, $args['id'] . $args['time'])); return oidUtil::append_args($base, $args); }