本文整理汇总了PHP中c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign方法的具体用法?PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign怎么用?PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_utils_strings
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rsa_sha1_sign
/**
* Generates an RSA-SHA1 signature.
*
* @package s2Member\Utilities
* @since 111017
*
* @param str $string Input string/data, to be signed by this routine.
* @param str $key The secret key that will be used in this signature.
* @return str|bool An RSA-SHA1 signature string, or false on failure.
*/
public static function rsa_sha1_sign($string = FALSE, $key = FALSE)
{
$key = c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers((string) $key);
/**/
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key);
/**/
if (empty($signature) && stripos(PHP_OS, "win") === 0 && file_exists($openssl = "c:\\openssl-win32\\bin\\openssl.exe")) {
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key, $openssl);
}
/**/
if (empty($signature) && stripos(PHP_OS, "win") === 0 && file_exists($openssl = "c:\\openssl-win64\\bin\\openssl.exe")) {
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key, $openssl);
}
/**/
if (empty($signature) && function_exists("openssl_get_privatekey") && function_exists("openssl_sign") && is_resource($private_key = openssl_get_privatekey((string) $key))) {
openssl_sign((string) $string, $signature, $private_key, OPENSSL_ALGO_SHA1) . openssl_free_key($private_key);
}
/**/
if (empty($signature)) {
/* Now, if we're still empty, trigger an error here. */
trigger_error("s2Member was unable to generate an RSA-SHA1 signature." . " Please make sure your installation of PHP is compiled with OpenSSL: `openssl_sign()`." . " See: http://php.net/manual/en/function.openssl-sign.php", E_USER_ERROR);
}
/**/
return !empty($signature) ? $signature : false;
}
示例2: rsa_sha1_sign
/**
* Generates an RSA-SHA1 signature.
*
* @package s2Member\Utilities
* @since 111017
*
* @param string $string Input string/data, to be signed by this routine.
* @param string $key The secret key that will be used in this signature.
*
* @return string|bool An RSA-SHA1 signature string, or false on failure.
*/
public static function rsa_sha1_sign($string = '', $key = '')
{
$key = c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers((string) $key);
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key);
if (empty($signature) && stripos(PHP_OS, 'win') === 0 && file_exists($openssl = 'c:\\openssl-win32\\bin\\openssl.exe')) {
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key, $openssl);
}
if (empty($signature) && stripos(PHP_OS, 'win') === 0 && file_exists($openssl = 'c:\\openssl-win64\\bin\\openssl.exe')) {
$signature = c_ws_plugin__s2member_utils_strings::_rsa_sha1_shell_sign((string) $string, (string) $key, $openssl);
}
if (empty($signature) && function_exists('openssl_get_privatekey') && function_exists('openssl_sign') && is_resource($private_key = openssl_get_privatekey((string) $key))) {
openssl_sign((string) $string, $signature, $private_key, OPENSSL_ALGO_SHA1) . openssl_free_key($private_key);
}
if (empty($signature)) {
// Now, if we're still empty, trigger an error here.
trigger_error('s2Member was unable to generate an RSA-SHA1 signature.' . ' Please make sure your installation of PHP is compiled with OpenSSL: `openssl_sign()`.' . ' See: http://php.net/manual/en/function.openssl-sign.php', E_USER_ERROR);
}
return !empty($signature) ? $signature : FALSE;
}