public class WeiXinSignatureUtil extends Object
Constructor and Description |
---|
WeiXinSignatureUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
createJsApiSignature(String noncestr,
String ticket,
String timestamp,
String url)
JS-SDK使用权限签名算法:
1. |
static String |
createPaySignature(Object o,
String key)
微信商户平台签名通用算法:
1.设所有发送或者接收到的数据为集合M,将集合M内非空参数值的参数按照参数名ASCII码从小到大排序(字典序),使用URL键值对的格式(即key1 =value1&key2=value2…)拼接成字符串stringA 2.在stringA最后拼接上key得到stringSignTemp字符串,并对stringSignTemp进行MD5运算, 再将得到的字符串所有字符转换为大写,得到sign值signValue 算法来源请参考:https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=4_3 |
protected static String |
createSha1Algorithm(String... str)
简化SHA-1算法
|
static String |
createSignature(String token,
String timestamp,
String nonce)
验证服务器地址的有效性算法:
1. |
static String |
decryptMessage(String xml,
String timestamp,
String nonce,
Client client)
解密微信消息(需要配置微信通讯模式为加密模式)
|
static String |
encryptMessage(String xml,
String timestamp,
String nonce,
Client client)
加密微信消息(需要配置微信通讯模式为加密模式)
微信加密算法采用AES算法,细节请参考文档:http://mp.weixin.qq.com/wiki/2/3478f69c0d0bbe8deb48d66a3111ff6e.html |
public static String createSignature(String token, String timestamp, String nonce)
signature
- timestamp
- nonce
- public static String createJsApiSignature(String noncestr, String ticket, String timestamp, String url)
public static String createPaySignature(Object o, String key)
o
- key
- public static String encryptMessage(String xml, String timestamp, String nonce, Client client)
xml
- timestamp
- nonce
- client
- public static String decryptMessage(String xml, String timestamp, String nonce, Client client)
xml
- client
- Copyright © 2006–2018 TinyGroup. All rights reserved.