金山WPS在线编辑
This commit is contained in:
@ -530,22 +530,28 @@ public class WpsServiceImpl implements WpsService {
|
|||||||
String mdKey = MdConstants.getSha256(time+fileId+appName+token);
|
String mdKey = MdConstants.getSha256(time+fileId+appName+token);
|
||||||
log.info("mdKey:"+mdKey);
|
log.info("mdKey:"+mdKey);
|
||||||
//fileId|token|yyyyMMddHHmmss|md5加密
|
//fileId|token|yyyyMMddHHmmss|md5加密
|
||||||
String rsaKey = fileId+"|"+token+"|"+time+"|"+mdKey;
|
String rsaKey = fileId+"|"+token+"|"+time;
|
||||||
log.info("rsaKey:"+rsaKey);
|
log.info("rsaKey:"+rsaKey);
|
||||||
//RSA加密
|
//RSA加密
|
||||||
String key = RSA.encrypt(rsaKey,kswpublicKey);
|
String key = RSA.encrypt(rsaKey,kswpublicKey);
|
||||||
log.info("key:"+key);
|
log.info("key:"+key);
|
||||||
|
|
||||||
return key;
|
return key+"|"+mdKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String downloadDecrypt(String key){
|
private String downloadDecrypt(String key){
|
||||||
String[] value = RSA.decrypt(key,kswprivateKey).split("|");
|
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("令牌无效",key.indexOf("|")<0);
|
||||||
|
|
||||||
|
String[] k = key.split("|");
|
||||||
|
String md = k[1];
|
||||||
|
String val = RSA.decrypt(k[0],kswprivateKey);
|
||||||
|
CommonExceptionEnum.FRAME_EXCEPTION_COMMON_DATA_OTHER_ERROR.customValidName("令牌无效",val.indexOf("|")<0);
|
||||||
|
|
||||||
|
String[] value = val.split("|");
|
||||||
|
|
||||||
String fileId = value[0];
|
String fileId = value[0];
|
||||||
String token = value[1];
|
String token = value[1];
|
||||||
String time = value[2];
|
String time = value[2];
|
||||||
String md = value[3];
|
|
||||||
|
|
||||||
String o_key = MdConstants.getSha256(time+fileId+appName+token);//
|
String o_key = MdConstants.getSha256(time+fileId+appName+token);//
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user