com.jfinal.weixin.sdk.kit

## 类 SignatureCheckKit

- java.lang.Object
- - com.jfinal.weixin.sdk.kit.SignatureCheckKit

-     public class SignatureCheckKit
      extends Object

  测试用的账号： appID = wx9803d1188fa5fbda appsecret = db859c968763c582794e7c3d003c3d87 url = http://www.jfinal.com/weixin token = __my__token__

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `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; }

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### me

          public static final SignatureCheckKit me

  - ### 构造器详细资料

    - #### SignatureCheckKit

          public SignatureCheckKit()

  - ### 方法详细资料

    - #### checkSignature

          public 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;
                  }

      参数:
        `signature` - 微信加密签名
        `timestamp` - 时间戳
        `nonce` - 随机字符串
      返回:
        {boolean}

    - #### checkSignature

          public boolean checkSignature(com.jfinal.core.Controller c)

Copyright © 2017. All rights reserved.