@Component
@ConditionalOnProperty(value="weixin.enable-message-enc",
havingValue="true")
public class WeiXinMsgCodec
extends Object
适用JDK6的JCE补丁: http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html 适用JDK7的JCE补丁: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html 适用JDK8的JCE补丁: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
| 构造器和说明 |
|---|
WeiXinMsgCodec() |
@PostConstruct public void postConstruct() throws AesException
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 encrypt(String text) throws AesException
text - 要加密的信息AesExceptionCopyright © 2021. All rights reserved.