当前位置: 首页>>代码示例>>PHP>>正文


PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers方法代码示例

本文整理汇总了PHP中c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers方法的具体用法?PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers怎么用?PHP c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在c_ws_plugin__s2member_utils_strings的用法示例。


在下文中一共展示了c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers方法的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;
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:35,代码来源:utils-strings.inc.php

示例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;
 }
开发者ID:codeforest,项目名称:s2member,代码行数:30,代码来源:utils-strings.inc.php


注:本文中的c_ws_plugin__s2member_utils_strings::_rsa_sha1_key_fix_wrappers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。