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


PHP sign函数代码示例

本文整理汇总了PHP中sign函数的典型用法代码示例。如果您正苦于以下问题:PHP sign函数的具体用法?PHP sign怎么用?PHP sign使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sign函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cx

 public function cx($conf)
 {
     $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '00', 'txnSubType' => '00', 'bizType' => '000000', 'accessType' => '0', 'channelType' => '07', 'orderId' => $conf['ordernumber'], 'merId' => '898110248160161', 'txnTime' => date("YmdHis", strtotime($conf['addtime'])));
     // 签名
     sign($params);
     // 发送信息到后台
     $result = sendHttpRequest($params, SDK_SINGLE_QUERY_URL);
     //返回结果展示
     $result_arr = coverStringToArray($result);
     $insert = array();
     $insert['ordernumber'] = $conf['ordernumber'];
     $insert['fqtime'] = $conf['addtime'];
     $insert['ylnumber'] = isset($result_arr['queryId']) ? $result_arr['queryId'] : 0;
     $insert['yltime'] = isset($result_arr['traceTime']) ? $result_arr['traceTime'] : 0;
     $insert['ylstatus'] = $conf['cztype'];
     $insert['cxtime'] = date("Y-m-d  H:i:s");
     $insert['cxstatus'] = $result_arr['respCode'];
     $insert['cxmiaosu'] = $result_arr['respMsg'];
     $insert['userId'] = $conf['userId'];
     $insert['origRespCode'] = isset($result_arr['origRespCode']) ? $result_arr['origRespCode'] : 0;
     $insert['origRespMsg'] = isset($result_arr['origRespMsg']) ? $result_arr['origRespMsg'] : 0;
     $this->db->insert("yinlian", $insert);
     if ($this->db->insert_id() > 0) {
         $this->db->query("update  `cz`  set  `cl`=1  where   logId=" . $conf['logId']);
     }
 }
开发者ID:q546530715,项目名称:fenzhi-git,代码行数:26,代码来源:yinlian.php

示例2: build_mysign

function build_mysign($sort_array, $security_code, $sign_type = "MD5")
{
    $prestr = create_linkstring($sort_array);
    $prestr = $prestr . $security_code;
    $mysgin = sign($prestr, $sign_type);
    return $mysgin;
}
开发者ID:keyu199314,项目名称:php,代码行数:7,代码来源:alipay_function.php

示例3: preparePutRequest

function preparePutRequest($merchantId, $payId, $dttm, $privateKey, $privateKeyPassword)
{
    $data = array("merchantId" => $merchantId, "payId" => $payId, "dttm" => $dttm);
    $text = $merchantId . "|" . $payId . "|" . $dttm;
    $data['signature'] = sign($text, $privateKey, $privateKeyPassword, "data to sign:");
    return $data;
}
开发者ID:TomHetmer,项目名称:paymentgateway,代码行数:7,代码来源:crypto.php

示例4: before

 public function before($controller, $metadata, &$data)
 {
     if (!$controller->request->input->exists('app_id')) {
         throw new BadRequestException("Missing app id.");
     }
     $conf = Config::Get('apps');
     $app = $conf->{$controller->request->input->app_id};
     if (!$app->signed) {
         return;
     }
     if (!$controller->request->input->exists('app_id', 'signature', 'time')) {
         throw new BadRequestException("Missing signature.");
     }
     $signature = str_replace(' ', '+', $controller->request->input->signature);
     $vals = array();
     foreach ($controller->request->input as $key => $val) {
         if (!in_array($key, array('signature', 'time'))) {
             $vals[$key] = $val;
         }
     }
     $sig = sign($vals, $app->key, $controller->request->input->time);
     if ($sig['signature'] != $signature) {
         throw new BadRequestException("Invalid signature.");
     }
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:25,代码来源:signed.php

示例5: dopay

 public function dopay($money = null, $order = null, $ordername = null, $reqReserved = '透传信息')
 {
     //取插件配置参数
     $conf = F('pluginunionpay');
     if (empty($conf) || APP_DEBUG) {
         $data = M('Addons')->field('param')->where("mark='Unionpay'")->find();
         $conf = json_decode($data['param'], true);
         F('pluginunionpay', $conf);
     }
     define('UNIONPAY_MEMBER_ID', $conf['MEMBER_ID']);
     include_once UNIONPAY_PATH . '/lib/utf8/func/SDKConfig.php';
     include_once UNIONPAY_PATH . '/lib/utf8/func/common.php';
     include_once UNIONPAY_PATH . '/lib/utf8/func/PinBlock.php';
     include_once UNIONPAY_PATH . '/lib/utf8/func/PublicEncrypte.php';
     include_once UNIONPAY_PATH . '/lib/utf8/func/secureUtil.php';
     include_once UNIONPAY_PATH . '/lib/utf8/func/httpClient.php';
     /**
      *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
      */
     // 初始化日志
     //$log = new PhpLog ( SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL );
     //$log->LogInfo ( "============处理前台请求开始===============" );
     // 初始化日志
     $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => MEMBER_ID, 'orderId' => $order, 'txnTime' => date('YmdHis'), 'txnAmt' => $money * 100, 'currencyCode' => '156', 'orderDesc' => $ordername, 'reqReserved' => $reqReserved);
     // 签名
     sign($params);
     // 前台请求地址
     $front_uri = SDK_FRONT_TRANS_URL;
     $html_form = create_html($params, $front_uri);
     return $html_form;
 }
开发者ID:735579768,项目名称:Ainiku,代码行数:31,代码来源:UnionpayPlugin.class.php

示例6: buildMysign

function buildMysign($sort_para, $key, $sign_type = "MD5")
{
    $prestr = createLinkstring($sort_para);
    $prestr = $prestr . $key;
    $mysgin = sign($prestr, $sign_type);
    return $mysgin;
}
开发者ID:keyu199314,项目名称:php,代码行数:7,代码来源:alipay_core.function.php

示例7: init

 public function init()
 {
     parent::init();
     $conf = Config::Get($this->config_file);
     $this->conf = $conf->{$this->type};
     $this->app_id = $conf->app_id ? $conf->app_id : $this->app_id;
     $this->secret = $conf->app_id ? $conf->secret : $this->secret;
     $this->auth = $this->session->build_session();
     $this->forced_formats = $this->conf->forced_formats ? $this->conf->forced_formats : $this->forced_formats;
     $this->formats = $this->conf->formats ? $this->conf->formats : $this->formats;
     $this->queue_limit = $this->conf->queue_limit ? $this->conf->queue_limit : $this->queue_limit;
     $this->max_files = $this->conf->max_files ? $this->conf->max_files : $this->max_files;
     $this->file_formats = $this->conf->file_formats ? $this->conf->file_formats : $this->file_formats;
     $this->allowed_filesize = $this->conf->allowed_filesize ? $this->conf->allowed_filesize : $this->allowed_filesize;
     $this->form = $this->conf->form ? $this->conf->form : $this->form;
     $this->script = $this->conf->script ? $this->conf->script : $this->script;
     $this->container = $this->conf->container ? $this->conf->container : $this->container;
     if ($this->content && $this->content->fields) {
         foreach ($this->content->fields->field as $item) {
             $this->fields[(string) $item['name']] = (string) $item['value'];
         }
     }
     $sig = sign(array('app_id' => $this->app_id, 'formats' => $this->formats, 'forced_formats' => $this->forced_formats), $this->secret);
     $this->time = $sig['time'];
     $this->signature = $sig['signature'];
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:26,代码来源:cloudupload.php

示例8: build_mysign

function build_mysign($sort_array)
{
    //把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
    $prestr = create_linkstring($sort_array);
    //调用RSA签名方法
    $mysgin = sign($prestr);
    return $mysgin;
}
开发者ID:buziyborni,项目名称:cnode-cc,代码行数:8,代码来源:alipay_function.php

示例9: goPay

 public function goPay($payDetail)
 {
     $this->params["txnAmt"] = $payDetail["payMoney"] * 100;
     $this->params["orderId"] = $payDetail["unitePayID"];
     $params = $this->params;
     sign($params);
     return create_html($params, SDK_FRONT_TRANS_URL);
 }
开发者ID:onlineshine,项目名称:myzf,代码行数:8,代码来源:unionpay.php

示例10: build_mysign

function build_mysign($sort_array, $key, $sign_type = "MD5")
{
    $prestr = create_linkstring($sort_array);
    $prestr = $prestr . $key;
    log_result("sign : " . $prestr);
    $mysgin = sign($prestr, $sign_type);
    return $mysgin;
}
开发者ID:haibocu,项目名称:lifark,代码行数:8,代码来源:alipay_function.php

示例11: verify

/**
 * RSA验签
 * @param $data   待签名数据
 * @param $priKey 密钥
 * @param $sign   要校对的的签名结果
 * return 验证结果
 */
function verify($data, $priKey, $sign)
{
    $selfSign = sign($data, $priKey);
    if ($selfSign === $sign) {
        return true;
    } else {
        return false;
    }
}
开发者ID:tofindme,项目名称:work_note,代码行数:16,代码来源:lenovo_cashier_rsa.inc.php

示例12: build_mysign

function build_mysign($sort_array, $key, $sign_type = "MD5")
{
    $prestr = create_linkstring($sort_array);
    //把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
    $prestr = $prestr . $key;
    //把拼接后的字符串再与安全校验码直接连接起来
    $mysgin = sign($prestr, $sign_type);
    //把最终的字符串签名,获得签名结果
    return $mysgin;
}
开发者ID:fenhaoyuan,项目名称:aozhouzhengpin,代码行数:10,代码来源:alipay_direct_function.php

示例13: buildMysign

/**
 * 生成签名结果
 * @param $sort_para 要签名的数组
 * @param $key 支付宝交易安全校验码
 * @param $sign_type 签名类型 默认值:MD5
 * return 签名结果字符串
 */
function buildMysign($sort_para, $key, $sign_type = "MD5")
{
    //把数组所有元素,按照“参数=参数值”的模式用“&”字符拼接成字符串
    $prestr = createLinkstring($sort_para);
    //把拼接后的字符串再与安全校验码直接连接起来
    $prestr = $prestr . $key;
    //把最终的字符串签名,获得签名结果
    $mysgin = sign($prestr, $sign_type);
    return $mysgin;
}
开发者ID:yunsite,项目名称:tp-coupon,代码行数:17,代码来源:alipay_core.function.php

示例14: ksso

function ksso()
{
    $soapUser = '';
    $soapPassword = '';
    $publicKeyStr = '';
    $cookieValue = $_COOKIE['SATHTOKEN'];
    $soap = new SoapClient('https://iam.kaist.ac.kr/iamps/services/singlauth?wsdl');
    $result = $soap->verification(array('cookieValue' => $cookieValue, 'publicKeyStr' => $publicKeyStr, 'adminVO' => array('adminId' => $soapUser, 'password' => $soapPassword)));
    setcookie("SATHTOKEN", "", time() - 3600, '/');
    return sign($result->return);
}
开发者ID:talkwithraon,项目名称:XE4KAIST,代码行数:11,代码来源:ksso.php

示例15: request

function request($bssid, $ssid, $salt, $dhid = 'ff8080814cc5798a014ccbbdfa375369')
{
    $data = array('appid' => '0008', 'bssid' => $bssid, 'chanid' => 'gw', 'dhid' => $dhid, 'ii' => '609537f302fc6c32907a935fb4bf7ac9', 'lang' => 'cn', 'mac' => '60f81dad28de', 'method' => 'getDeepSecChkSwitch', 'pid' => 'qryapwd:commonswitch', 'ssid' => $ssid, 'st' => 'm', 'uhid' => 'a0000000000000000000000000000001', 'v' => '324');
    $data['sign'] = sign($data, $salt);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'http://wifiapi02.51y5.net/wifiapi/fa.cmd');
    curl_setopt($curl, CURLOPT_USERAGENT, 'WiFiMasterKey/1.1.0 (Mac OS X Version 10.10.3 (Build 14D136))');
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $ret = json_decode(curl_exec($curl), true);
    curl_close($curl);
    return $ret;
}
开发者ID:CaledoniaProject,项目名称:LianWifi-Ver-324,代码行数:16,代码来源:local.php


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