Blame view

src/com/ectrip/cyt/utils/SignTools.java 656 Bytes
07670a44   黄灿宏   畅游通核销app: 1.增加日志上...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  package com.ectrip.cyt.utils;
  
  
  import com.ectrip.cyt.constant.CheckTicketConstant;
  
  
  /**
   * 签名工具
   * Created by lingkitho on 2017/3/1.
   */
  public class SignTools {
  
      /**
       * 签名
       * @param data
       * @return
       */
      public static String getSign(String data) {
          if(null != data) {
              return EncryptUtil.MD5Hex(data + CheckTicketConstant.MD5KEY);
          }else {
              return null;
          }
      }
  
      /**
       * 检查签名
       * @param signKey
       * @param data
       * @return
       */
      public static boolean chechSign(String signKey, String data){
          return signKey.equals(getSign(data));
      }
  }