收藏
回答

javax.crypto.AEADBadTagException: Tag mismatch?

支付成功后回调解密报文出现这个javax.crypto.AEADBadTagException: Tag mismatch!

用的AesUtil这个类


回答关注问题邀请回答
收藏

4 个回答

  • 高升
    高升
    2020-10-13

    我也遇到同样的问题?哪位解决了给我说下 麻烦了

    2020-10-13
    有用
    回复
  • 星辰
    星辰
    2020-01-18

    你好,请问解决了么?

    2020-01-18
    有用
    回复
  • tars
    tars
    2019-10-12

    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);

      }




    2019-10-12
    有用
    回复
  • 微信支付技术助手1
    微信支付技术助手1
    2019-10-12

    具体调用的哪个API,V2,还是V3接口。请详细描述一下问题

    2019-10-12
    有用
    回复 5
    • tars
      tars
      2019-10-12
      v3接口
      2019-10-12
      回复
    • nutsKevin
      nutsKevin
      2019-11-15回复tars
      你好,请问你这个问题解决了吗
      2019-11-15
      回复
    • 高升
      高升
      2020-10-13
      v3
      2020-10-13
      回复
    • 高升
      高升
      2020-10-13
      麻烦帮忙解决一下,问题卡了2天了
      2020-10-13
      回复
    • .︶ㄣ☆.'龍
      .︶ㄣ☆.'龍
      2022-12-19回复高升
      您好,你的问题解决了吗?
      2022-12-19
      回复
登录 后发表内容