public class SignatureCheckKit extends Object
限定符和类型 | 字段和说明 |
---|---|
static SignatureCheckKit |
me |
构造器和说明 |
---|
SignatureCheckKit() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
checkSignature(com.jfinal.core.Controller c) |
boolean |
checkSignature(String signature,
String timestamp,
String nonce)
php 示例
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$token = TOKEN;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode( $tmpArr );
$tmpStr = sha1( $tmpStr );
if( $tmpStr == $signature ){
return true;
}else{
return false;
}
|
public static final SignatureCheckKit me
public boolean checkSignature(String signature, String timestamp, String nonce)
$signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr, SORT_STRING); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ){ return true; }else{ return false; }
signature
- 微信加密签名timestamp
- 时间戳nonce
- 随机字符串public boolean checkSignature(com.jfinal.core.Controller c)
Copyright © 2017. All rights reserved.