Commit c586667a authored by 黎博's avatar 黎博

debug

parent 07766c02
......@@ -15,7 +15,7 @@ import java.util.Map;
public class YeebaoEncryptConvertor implements EncryptConvertor{
@Value("${yeebao.private.key}")
private String privateKey;
private String YeebaoPrivateKey;
private String aesKey = null;
private String encryptKey = null;
......@@ -30,7 +30,7 @@ public class YeebaoEncryptConvertor implements EncryptConvertor{
try {
Map responseMap = JSON.parseObject(response, Map.class);
Map<String, Object> signData = new HashMap<>();
responseMap.put("sign", Rsa.sign(response, privateKey));
responseMap.put("sign", Rsa.sign(response, YeebaoPrivateKey));
signData.put("encryptkey", encryptKey);
signData.put("data", Aes.encryptToBase64(JSON.toJSONString(responseMap), aesKey));
return JSON.toJSONString(signData);
......@@ -48,10 +48,10 @@ public class YeebaoEncryptConvertor implements EncryptConvertor{
@Override
public String decrypt(String request) {
try {
log.info("易宝privateKey======= ", privateKey);
log.info("易宝privateKey======= ", YeebaoPrivateKey);
Map requestMap = JSON.parseObject(request, Map.class);
encryptKey = requestMap.get("encryptkey").toString();
aesKey = Rsa.decrypt(encryptKey, privateKey);
aesKey = Rsa.decrypt(encryptKey, YeebaoPrivateKey);
return Aes.decryptFromBase64((String) requestMap.get("data"), aesKey);
} catch (Exception e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment