java微信申请退款回调的注意点

public String decryptData(String base64Data, String md532Str) throws Exception {

    initialize();
    BASE64Decoder decoder = new BASE64Decoder();
    Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
    SecretKeySpec sKeySpec = new SecretKeySpec(md532Str.getBytes(), "AES");
    cipher.init(Cipher.DECRYPT_MODE, sKeySpec);
    return new String(cipher.doFinal(decoder.decodeBuffer(base64Data)),"UTF-8");
}

原因:AES在JDK正常下载的是有限制的解密位数的 解决:去oracle的javaSE下载对应jce解密jar,下载无敌解密jar包,替换jar中相应jar包

经验分享 程序员 微信小程序 职场和发展