小程序
小游戏
企业微信
微信支付
扫描小程序码分享
支付成功后回调解密报文出现这个javax.crypto.AEADBadTagException: Tag mismatch!
用的AesUtil这个类
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
我也遇到同样的问题?哪位解决了给我说下 麻烦了
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,请问解决了么?
v3接口
这是我返回的报文
{id=338e5a74-5110-5688-b0f0-37dd8a3612ce, create_time=2019-10-10T15:09:11+08:00, resource_type=encrypt-resource, event_type=TRANSACTION.SUCCESS, summary=支付成功, resource={original_type=transaction, algorithm=AEAD_AES_256_GCM, ciphertext=cxJk14Tr2yShHdEa75ZEWKHOg7DG+p4NJerOW36UdI0Ja0RxmIwFmnzAAVHtTbfxSq/R1btbCYhKtUzJz/VFd0duyUY5O2OznJClA1OA/qHcLGQSIEDIUbn3msKt6gqy8/WyBDA5ouiAVI+woASvdMDmdnTCWj5Es49hrU/d2Qvsry6kmOtnkG6lURY2Zbw8xLy87Y06Ax1LxfdiRB1B8GYgkDEfe9ISNueDaXJVpNcxaoDKs0SjgqxuQH1nsEvuFUCJrQ4/V7IDBFvIFWBeaQsNQfwaZMYI1Ht44f0SO2DyISskfFv5yGNUERaN3j/u6H/e9T7A/DGeMdGpf4I8LcjbglcpUSq9RbcaEv4PsJC3lpXJNxfjKUmH6CdWC40VnxioepiH4rGvVKqPP2U4R84W2c98ZlYCbP3qv234QwoyIM7byPNrJzdd+uH/qVJ37QfeoI7JUexJMEM2/PUM1+4IWLRo1xTExgj9xPjNIEOzmbQs3fiXA+VsRe70VfBPCZCjBg3RUkRPUgBuvGrNw9/xE+ZofSguI1mp+aRorfPFcJ4t3a431kot25nLCwVEB83h4qIYZlilSNciBmXsW30yYQs4TNWTrTysKp1OPTkebf/rlrUTuxvbcOL1R08F6W+vMj9sk8EkBXMijybaxAl36Qf7ZxKrkyrMb3987aKt, associated_data=transaction, nonce=WYthGzPCnFOR}
这是我用main方法解密
public static void main(String[] args) throws GeneralSecurityException, IOException {
String s = new AesUtil("xxxxxxxxx".getBytes())
.decryptToString("transaction".getBytes(), "WYthGzPCnFOR".getBytes(),
"cxJk14Tr2yShHdEa75ZEWKHOg7DG+p4NJerOW36UdI0Ja0RxmIwFmnzAAVHtTbfxSq/R1btbCYhKtUzJz/VFd0duyUY5O2OznJClA1OA/qHcLGQSIEDIUbn3msKt6gqy8/WyBDA5ouiAVI+woASvdMDmdnTCWj5Es49hrU/d2Qvsry6kmOtnkG6lURY2Zbw8xLy87Y06Ax1LxfdiRB1B8GYgkDEfe9ISNueDaXJVpNcxaoDKs0SjgqxuQH1nsEvuFUCJrQ4/V7IDBFvIFWBeaQsNQfwaZMYI1Ht44f0SO2DyISskfFv5yGNUERaN3j/u6H/e9T7A/DGeMdGpf4I8LcjbglcpUSq9RbcaEv4PsJC3lpXJNxfjKUmH6CdWC40VnxioepiH4rGvVKqPP2U4R84W2c98ZlYCbP3qv234QwoyIM7byPNrJzdd+uH/qVJ37QfeoI7JUexJMEM2/PUM1+4IWLRo1xTExgj9xPjNIEOzmbQs3fiXA+VsRe70VfBPCZCjBg3RUkRPUgBuvGrNw9/xE+ZofSguI1mp+aRorfPFcJ4t3a431kot25nLCwVEB83h4qIYZlilSNciBmXsW30yYQs4TNWTrTysKp1OPTkebf/rlrUTuxvbcOL1R08F6W+vMj9sk8EkBXMijybaxAl36Qf7ZxKrkyrMb3987aKt");
System.out.println(s);
}
具体调用的哪个API,V2,还是V3接口。请详细描述一下问题
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
我也遇到同样的问题?哪位解决了给我说下 麻烦了
你好,请问解决了么?
v3接口
这是我返回的报文
{id=338e5a74-5110-5688-b0f0-37dd8a3612ce, create_time=2019-10-10T15:09:11+08:00, resource_type=encrypt-resource, event_type=TRANSACTION.SUCCESS, summary=支付成功, resource={original_type=transaction, algorithm=AEAD_AES_256_GCM, ciphertext=cxJk14Tr2yShHdEa75ZEWKHOg7DG+p4NJerOW36UdI0Ja0RxmIwFmnzAAVHtTbfxSq/R1btbCYhKtUzJz/VFd0duyUY5O2OznJClA1OA/qHcLGQSIEDIUbn3msKt6gqy8/WyBDA5ouiAVI+woASvdMDmdnTCWj5Es49hrU/d2Qvsry6kmOtnkG6lURY2Zbw8xLy87Y06Ax1LxfdiRB1B8GYgkDEfe9ISNueDaXJVpNcxaoDKs0SjgqxuQH1nsEvuFUCJrQ4/V7IDBFvIFWBeaQsNQfwaZMYI1Ht44f0SO2DyISskfFv5yGNUERaN3j/u6H/e9T7A/DGeMdGpf4I8LcjbglcpUSq9RbcaEv4PsJC3lpXJNxfjKUmH6CdWC40VnxioepiH4rGvVKqPP2U4R84W2c98ZlYCbP3qv234QwoyIM7byPNrJzdd+uH/qVJ37QfeoI7JUexJMEM2/PUM1+4IWLRo1xTExgj9xPjNIEOzmbQs3fiXA+VsRe70VfBPCZCjBg3RUkRPUgBuvGrNw9/xE+ZofSguI1mp+aRorfPFcJ4t3a431kot25nLCwVEB83h4qIYZlilSNciBmXsW30yYQs4TNWTrTysKp1OPTkebf/rlrUTuxvbcOL1R08F6W+vMj9sk8EkBXMijybaxAl36Qf7ZxKrkyrMb3987aKt, associated_data=transaction, nonce=WYthGzPCnFOR}
这是我用main方法解密
public static void main(String[] args) throws GeneralSecurityException, IOException {
String s = new AesUtil("xxxxxxxxx".getBytes())
.decryptToString("transaction".getBytes(), "WYthGzPCnFOR".getBytes(),
"cxJk14Tr2yShHdEa75ZEWKHOg7DG+p4NJerOW36UdI0Ja0RxmIwFmnzAAVHtTbfxSq/R1btbCYhKtUzJz/VFd0duyUY5O2OznJClA1OA/qHcLGQSIEDIUbn3msKt6gqy8/WyBDA5ouiAVI+woASvdMDmdnTCWj5Es49hrU/d2Qvsry6kmOtnkG6lURY2Zbw8xLy87Y06Ax1LxfdiRB1B8GYgkDEfe9ISNueDaXJVpNcxaoDKs0SjgqxuQH1nsEvuFUCJrQ4/V7IDBFvIFWBeaQsNQfwaZMYI1Ht44f0SO2DyISskfFv5yGNUERaN3j/u6H/e9T7A/DGeMdGpf4I8LcjbglcpUSq9RbcaEv4PsJC3lpXJNxfjKUmH6CdWC40VnxioepiH4rGvVKqPP2U4R84W2c98ZlYCbP3qv234QwoyIM7byPNrJzdd+uH/qVJ37QfeoI7JUexJMEM2/PUM1+4IWLRo1xTExgj9xPjNIEOzmbQs3fiXA+VsRe70VfBPCZCjBg3RUkRPUgBuvGrNw9/xE+ZofSguI1mp+aRorfPFcJ4t3a431kot25nLCwVEB83h4qIYZlilSNciBmXsW30yYQs4TNWTrTysKp1OPTkebf/rlrUTuxvbcOL1R08F6W+vMj9sk8EkBXMijybaxAl36Qf7ZxKrkyrMb3987aKt");
System.out.println(s);
}
具体调用的哪个API,V2,还是V3接口。请详细描述一下问题