public String decryptToStringApiV2(byte[] associatedData, byte[] nonce, String ciphertext) throws GeneralSecurityException { try { Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); SecretKeySpec key = new SecretKeySpec(this.aesKey, "AES"); GCMParameterSpec spec = new GCMParameterSpec(128, nonce); cipher.init(2, key, spec); cipher.updateAAD(associatedData); return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), StandardCharsets.UTF_8); } catch (NoSuchPaddingException | NoSuchAlgorithmException var7) { GeneralSecurityException e = var7; throw new IllegalStateException(e); } catch (InvalidAlgorithmParameterException | InvalidKeyException var8) { GeneralSecurityException e = var8; throw new IllegalArgumentException(e); } } new RSAPublicKeyConfig.Builder() .merchantId(payConfig.getMerchantId()) .privateKeyFromPath(keyPath) .publicKeyFromPath(publicKeyPath) .publicKeyId(payConfig.getPublicKeyId()) .merchantSerialNumber(payConfig.getMerchantSerialNumber()) .apiV3Key(payConfig.getApiV3Key()) .build();
RSAPublicKeyConfig公钥方式微信商户发起转账,用户可以收到钱。但是回调解析报错?RSAPublicKeyConfig 公钥 方式 微信商户发起转账,用户可以收到钱。但是回调解析报Tag mismatch! 我看网上很多说是apv3 key错误,但是都可以发起转账,应该是对的
01-16