public static String decrypt(String rsaPubKey, String strDesKey, String encrypt) { String reqBody = ""; try { reqBody = ThreeDesUtil.decrypt4HexStr(RSAUtil.decryptBASE64(strDesKey), new String(Base64.decodeBase64(encrypt), "UTF-8")); String inputSign = JdPayXmlUtil.getXmlElm(reqBody, SIGN); reqBody = JdPayXmlUtil.addXmlHead(reqBody); reqBody = JdPayXmlUtil.fomatXmlStr(reqBody); String genSignStr = JdPayXmlUtil.delXmlElm(reqBody, SIGN); boolean verifyResult = VerifySignatureUtl.decryptMerchant(genSignStr, inputSign, rsaPubKey); if(!verifyResult) { logger.error("verify signature failed"); throw new RuntimeException("verify signature failed"); } else { return reqBody; } } catch (Exception var7) { logger.error("data decrypt failed"); throw new RuntimeException("data decrypt failed"); } }
京东 解密方法第一个参数rsaPubKey, 是京东平台给对接方 生成好的公钥