本文整理汇总了PHP中Auth_OpenID_KVForm::fromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_KVForm::fromArray方法的具体用法?PHP Auth_OpenID_KVForm::fromArray怎么用?PHP Auth_OpenID_KVForm::fromArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth_OpenID_KVForm
的用法示例。
在下文中一共展示了Auth_OpenID_KVForm::fromArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Auth_OpenID_associate
function Auth_OpenID_associate($qs, $assoc_secret, $assoc_handle)
{
$query_data = Auth_OpenID_parse($qs);
assert(count($query_data) == 6 || count($query_data) == 4);
assert($query_data['openid.mode'] == 'associate');
assert($query_data['openid.assoc_type'] == 'HMAC-SHA1');
assert($query_data['openid.session_type'] == 'DH-SHA1');
$reply_dict = array('assoc_type' => 'HMAC-SHA1', 'assoc_handle' => $assoc_handle, 'expires_in' => '600');
$dh_args = Auth_OpenID_DiffieHellman::serverAssociate($query_data, $assoc_secret);
$reply_dict = array_merge($reply_dict, $dh_args);
return Auth_OpenID_KVForm::fromArray($reply_dict);
}
示例2: Auth_OpenID_associate
function Auth_OpenID_associate($qs, $assoc_secret, $assoc_handle)
{
$query_data = Auth_OpenID_parse($qs);
assert($query_data['openid.mode'] == 'associate');
assert($query_data['openid.assoc_type'] == 'HMAC-SHA1');
$reply_dict = array('assoc_type' => 'HMAC-SHA1', 'assoc_handle' => $assoc_handle, 'expires_in' => '600');
if (defined('Auth_OpenID_NO_MATH_SUPPORT')) {
assert(count($query_data) == 2);
$message = Auth_OpenID_Message::fromPostArgs($query_data);
$session = Auth_OpenID_PlainTextServerSession::fromMessage($message);
} else {
assert(count($query_data) == 6 || count($query_data) == 4);
assert($query_data['openid.mode'] == 'associate');
assert($query_data['openid.session_type'] == 'DH-SHA1');
$message = Auth_OpenID_Message::fromPostArgs($query_data);
$session = Auth_OpenID_DiffieHellmanSHA1ServerSession::fromMessage($message);
$reply_dict['session_type'] = 'DH-SHA1';
}
$reply_dict = array_merge($reply_dict, $session->answer($assoc_secret));
return Auth_OpenID_KVForm::fromArray($reply_dict);
}
示例3: encodeToKVForm
/**
* Encodes the response to key-value form. This is a
* machine-readable format used to respond to messages which came
* directly from the consumer and not through the user-agent. See
* the OpenID specification.
*/
function encodeToKVForm()
{
return Auth_OpenID_KVForm::fromArray(
array('mode' => 'error',
'error' => $this->toString()));
}
示例4: sign
/**
* Generate a signature for a sequence of (key, value) pairs
*
* @access private
* @param array $pairs The pairs to sign, in order. This is an
* array of two-tuples.
* @return string $signature The binary signature of this sequence
* of pairs
*/
function sign($pairs)
{
$kv = Auth_OpenID_KVForm::fromArray($pairs);
/* Invalid association types should be caught at constructor */
$callback = $this->_macs[$this->assoc_type];
return call_user_func_array($callback, array($this->secret, $kv));
}
示例5: toKVForm
function toKVForm()
{
// Generate a KVForm string that contains the parameters in
// this message. This will fail if the message contains
// arguments outside of the 'openid.' prefix.
return Auth_OpenID_KVForm::fromArray($this->toArgs());
}
示例6: encodeToKVForm
function encodeToKVForm()
{
return Auth_OpenID_KVForm::fromArray($this->fields);
}
示例7: _runTest
function _runTest()
{
$serialized = Auth_OpenID_KVForm::fromArray($this->arr);
$this->assertTrue($serialized === null, 'serialization unexpectedly succeeded');
}
示例8: sign
/**
* Generate a signature for a sequence of (key, value) pairs
*
* @access private
* @param array $pairs The pairs to sign, in order. This is an
* array of two-tuples.
* @return string $signature The binary signature of this sequence
* of pairs
*/
function sign($pairs)
{
$kv = Auth_OpenID_KVForm::fromArray($pairs);
return Auth_OpenID_HMACSHA1($this->secret, $kv);
}