|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.github.sd4324530.fastweixin.message.aes.WXBizMsgCrypt
public class WXBizMsgCrypt
提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串).
| 构造方法摘要 | |
|---|---|
WXBizMsgCrypt(String token,
String encodingAesKey,
String appId)
构造函数 |
|
| 方法摘要 | |
|---|---|
String |
decryptMsg(String msgSignature,
String timeStamp,
String nonce,
String postData)
检验消息的真实性,并且获取解密后的明文. |
String |
encryptMsg(String replyMsg,
String timeStamp,
String nonce)
将公众平台回复用户的消息加密打包. |
String |
verifyUrl(String msgSignature,
String timeStamp,
String nonce,
String echoStr)
验证URL |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public WXBizMsgCrypt(String token,
String encodingAesKey,
String appId)
throws AesException
token - 公众平台上,开发者设置的tokenencodingAesKey - 公众平台上,开发者设置的EncodingAESKeyappId - 公众平台appid
AesException - 执行失败,请查看该异常的错误码和具体的错误信息| 方法详细信息 |
|---|
public String encryptMsg(String replyMsg,
String timeStamp,
String nonce)
throws AesException
replyMsg - 公众平台待回复用户的消息,xml格式的字符串timeStamp - 时间戳,可以自己生成,也可以用URL参数的timestampnonce - 随机串,可以自己生成,也可以用URL参数的nonce
AesException - 执行失败,请查看该异常的错误码和具体的错误信息
public String decryptMsg(String msgSignature,
String timeStamp,
String nonce,
String postData)
throws AesException
msgSignature - 签名串,对应URL参数的msg_signaturetimeStamp - 时间戳,对应URL参数的timestampnonce - 随机串,对应URL参数的noncepostData - 密文,对应POST请求的数据
AesException - 执行失败,请查看该异常的错误码和具体的错误信息
public String verifyUrl(String msgSignature,
String timeStamp,
String nonce,
String echoStr)
throws AesException
msgSignature - 签名串,对应URL参数的msg_signaturetimeStamp - 时间戳,对应URL参数的timestampnonce - 随机串,对应URL参数的nonceechoStr - 随机串,对应URL参数的echostr
AesException - 执行失败,请查看该异常的错误码和具体的错误信息
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||