public class WxCryptUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected byte[] |
aesKey |
protected String |
appidOrCorpid |
protected String |
token |
| 构造器和说明 |
|---|
WxCryptUtil() |
WxCryptUtil(String token,
String encodingAesKey,
String appidOrCorpid)
构造函数
|
protected byte[] aesKey
protected String token
protected String appidOrCorpid
public String encrypt(String plainText)
plainText - 公众平台待回复用户的消息,xml格式的字符串protected String encrypt(String randomStr, String plainText)
plainText - 需要加密的明文public String decrypt(String msgSignature, String timeStamp, String nonce, String encryptedXml)
msgSignature - 签名串,对应URL参数的msg_signaturetimeStamp - 时间戳,对应URL参数的timestampnonce - 随机串,对应URL参数的nonceencryptedXml - 密文,对应POST请求的数据Copyright © 2017. All rights reserved.