微信回调过来的参数:{"signature":"a4954e4550167f4163b4bc3352c5df6348e3e548","timestamp":"1731082309","nonce":"1593149607","openid":"xxxxxxx","encrypt_type":"aes","msg_signature":"3c067374860a35698f9bed742cb5c0f072c9afb5"} 按照顺序加密参数得到的MSG_Sinature: Encrypt+ timestamp + nonce + 消息推送配置成功的令牌TOKEN; ,但是得到的MSG_Sinature和msg_signature 一直不一样, 微信回调过来的实体包:{"ToUserName":"XXXXXXXX","Encrypt":"OxA6gGOMQ0wepxY0CJ2bL5NdQgn++dSh9awyC3CfJHVOhFXuc4DEJYBwSHy8d3BkRrUj5gvFAcfSHCIB7FgFN9zVgG+X0rADL/CtkvOXjW/LIWAZwkc0jTaO+yGQK4uh2oTdU2MgWlUeFi1k8pkM0Yiv3RN2fWC+PKAZe/9mi7ab72SiH9eT8ovHxlLQsk6z7qaxpBQ+0R8K528PO7bq41FRtOFziFJuis9ToGcwWy25EBSrmsrE3x109YmTloQ0VhvdmHZ1sLneVZhQ00GumvX6ItgWty8b1Q1qnHpPs8aaUh/JhqTsCPLC4We4uk+n+2DmrS/Jm1eC9Ocdb1E3QibVL9BmJn8SVosF+xmwWfLlqYlzxpFiD1Zkj7wULiuTah3E0VAQLH6uoSadYeaf4SsWjJ5+a+8R70hd846Z7ZdI0Yu+OZ6MWhw2eLwN0J6k7w0hjQxMDpcQQFCFzKxxf3ZQkY7Ph6suFfuQ=="}
贴一下你的加密算法代码。
JSONObject bdObj = JSONObject.parseObject(bdJsn);
String miwen = bdObj.getString("Encrypt");
System.out.println("---包体里的密文miwen----=" + miwen);
String msgSign = miwen + timestamp + nonce + 配置的令牌token;
System.out.println("---msgSign----=" + msgSign);
String msgSignSha1 = SecureUtil.sha1(msgSign);
System.out.println("---msgSignSha1----=" + msgSignSha1);
if (msgSignSha1.equals(msgSignature)) {
这个一直对不上,进不来 bdJsn数据是body微信回调带过来的
}