vod普通加密
This commit is contained in:
@@ -75,15 +75,15 @@ public class PlayToken {
|
||||
//先校验token的有效时间
|
||||
Long expireTime = Long.valueOf(base.substring(base.lastIndexOf("_") + 1));
|
||||
// System.out.println("时间校验:" + expireTime);
|
||||
// if (System.currentTimeMillis() > expireTime) {
|
||||
// return false;
|
||||
// }
|
||||
if (System.currentTimeMillis() > expireTime) {
|
||||
return false;
|
||||
}
|
||||
//从DB获取token信息,判断token的有效性,业务方可自行实现
|
||||
VodAesTokenEntity dbToken = getToken(token);
|
||||
//判断是否已经使用过该token
|
||||
// if (dbToken == null || dbToken.getUseCount() > 0) {
|
||||
// return false;
|
||||
// }
|
||||
if (dbToken == null || dbToken.getUseCount() > 0) {
|
||||
return false;
|
||||
}
|
||||
dbToken.setUseCount(1);
|
||||
vodAesTokenDao.updateById(dbToken);
|
||||
//获取到业务属性信息,用于校验
|
||||
|
||||
@@ -157,7 +157,7 @@ public class SpdbUtil {
|
||||
submitTranscodeJobsRequest.setTemplateGroupId("d346d2609a058b9dfd9b8bb392175721");
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("CipherText",edk);
|
||||
jsonObject.put("DecryptKeyUri","http://59.110.212.44:8099?CipherText="+edk);
|
||||
jsonObject.put("DecryptKeyUri","http://api.nuttyreading.com/sys/vodAli/vodAliVideoRe?CipherText="+edk);
|
||||
jsonObject.put("KeyServiceType","KMS");
|
||||
submitTranscodeJobsRequest.setEncryptConfig(jsonObject.toJSONString());
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
|
||||
@@ -72,6 +72,7 @@ public class ShiroConfig {
|
||||
filterMap.put("/book/baseArea/getAllBaseArea","anon");//登录前获取全部区域
|
||||
// filterMap.put("/book/bookchaptercontent/**","anon");
|
||||
filterMap.put("/book/user/**","anon");
|
||||
filterMap.put("/sys/vodAli/vodAliVideoRe","anon");
|
||||
filterMap.put("/webjars/**", "anon");
|
||||
filterMap.put("/druid/**", "anon");
|
||||
filterMap.put("/app/**", "anon");
|
||||
|
||||
@@ -28,7 +28,7 @@ public class VodAliController {
|
||||
return "Illegal access";
|
||||
}
|
||||
if (null == cipherText)
|
||||
return "Illegal access";
|
||||
return "Illegal access !";
|
||||
|
||||
DecryptKMSDataKeyResponseBody decryptKMSDataKeyResponseBody = SpdbUtil.enKMS(cipherText);
|
||||
return decryptKMSDataKeyResponseBody.getPlaintext();
|
||||
|
||||
Reference in New Issue
Block a user