當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。