anderx před 4 roky
rodič
revize
1ffebcbd0b

+ 1 - 1
src/main/java/com/kede/common/utils/WxAPIV3AesUtil.java

@@ -36,7 +36,7 @@ public class WxAPIV3AesUtil {
             cipher.init(Cipher.DECRYPT_MODE, key, spec);
             cipher.updateAAD(associatedData);
  
-            return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), "utf-8");
+            return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext.replace("\r\n", ""))), "utf-8");
         } catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
             throw new IllegalStateException(e);
         } catch (InvalidKeyException | InvalidAlgorithmParameterException e) {