Package com.foxinmy.weixin4j.util
Class MessageUtil
- java.lang.Object
-
- com.foxinmy.weixin4j.util.MessageUtil
-
public final class MessageUtil extends Object
消息工具类- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description MessageUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
aesDecrypt(String appId, String encodingAesKey, String encryptContent)
对AES消息解密static String
aesEncrypt(String appId, String encodingAesKey, String xmlContent)
对xml消息加密static String
signature(String... para)
验证微信签名
-
-
-
Method Detail
-
signature
public static String signature(String... para)
验证微信签名- Parameters:
signature
- 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数- Returns:
- 开发者通过检验signature对请求进行相关校验。若确认此次GET请求来自微信服务器 请原样返回echostr参数内容,则接入生效 成为开发者成功,否则接入失败
- See Also:
- 接入指南
-
aesEncrypt
public static String aesEncrypt(String appId, String encodingAesKey, String xmlContent)
对xml消息加密- Parameters:
appId
- 应用IDencodingAesKey
- 加密密钥xmlContent
- 原始消息体- Returns:
- aes加密后的消息体
- Throws:
WeixinException
-
-