Exemplo n.º 1
0
 public function buildParamArray(BaseParam $param)
 {
     $param->filter();
     $param->sort();
     $param->setSign(EncryptionFactory::create($this->config)->sign($param->getParamString()));
     $param->setSignType($this->config->sign_type);
     return $param->getParams();
 }
Exemplo n.º 2
0
 public function buildParam(BaseParam $param, $result_type = 'array')
 {
     $param->filter();
     $param->sort();
     $param->setSign(EncryptionFactory::create($this->config)->sign($param->getParamString()));
     $param->setSignType($this->config->sign_type);
     if ($result_type == 'array') {
         return $param->getParams();
     } else {
         return $param->getParamString();
     }
 }
Exemplo n.º 3
0
 /**
  * 获取返回时签名验证结果
  *
  * @param BaseParam $param
  * @param             $sign
  *
  * @return bool
  */
 public function getSignVerify(BaseParam $param, $sign)
 {
     $param->filter();
     $param->sort();
     $param_str = $param->getParamString();
     $isSign = EncryptionFactory::create($this->config)->verify($param_str, $sign);
     return $isSign;
 }