vod普通加密
This commit is contained in:
@@ -6,6 +6,7 @@ import com.peanut.common.utils.SpdbUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@@ -15,7 +16,7 @@ public class VodAliController {
|
||||
private PlayToken playToken;
|
||||
|
||||
@GetMapping("/vodAliVideoRe")
|
||||
public String vodAliVideoRe(@RequestParam("CipherText") String cipherText,
|
||||
public byte[] vodAliVideoRe(@RequestParam("CipherText") String cipherText,
|
||||
@RequestParam("MtsHlsUriToken") String mtsHlsUriToken){
|
||||
|
||||
boolean validRe = false;
|
||||
@@ -25,13 +26,13 @@ public class VodAliController {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!validRe) {
|
||||
return "Illegal access";
|
||||
return Base64.decodeBase64("Illegal access");
|
||||
}
|
||||
if (null == cipherText) {
|
||||
return Base64.decodeBase64("Illegal access !");
|
||||
}
|
||||
if (null == cipherText)
|
||||
return "Illegal access !";
|
||||
|
||||
DecryptKMSDataKeyResponseBody decryptKMSDataKeyResponseBody = SpdbUtil.enKMS(cipherText);
|
||||
return decryptKMSDataKeyResponseBody.getPlaintext();
|
||||
return Base64.decodeBase64(decryptKMSDataKeyResponseBody.getPlaintext());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user