时间戳服务
This commit is contained in:
@ -42,6 +42,7 @@ public class TimeServiceConstant {
|
||||
*/
|
||||
public String signTimeStamp(String data){
|
||||
try{
|
||||
data = data!=null&&!"".equals(data)?data:"system";
|
||||
//第三步:申请时间戳,向时间戳服务器发起申请时间戳请求,返回时间戳结果
|
||||
TSASignedResult result = client.signTimeStamp("SHA1", data.getBytes("UTF-8"));
|
||||
//第四步:获取时间戳数据,tsaData为时间戳数据,验证时间戳时使用,如果不是实时验证,需要将时间戳数据保存在应用服务器
|
||||
|
@ -20,7 +20,7 @@ public class TiemServiceController {
|
||||
* @return 时间戳加密原文
|
||||
*/
|
||||
@GetMapping(value = "/signTimeStamp")
|
||||
public BaseResponse<String> signTimeStamp(@ApiParam(value = "待申请时间戳的原文", required = true) @RequestParam(name = "data") String data) {
|
||||
public BaseResponse<String> signTimeStamp(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data") String data) {
|
||||
TimeServiceConstant constant = new TimeServiceConstant();
|
||||
return BaseResponse.success(constant.signTimeStamp(data));
|
||||
}
|
||||
@ -42,7 +42,7 @@ public class TiemServiceController {
|
||||
* @return 时间戳对象
|
||||
*/
|
||||
@PostMapping(value = "/getServiceTimeObj")
|
||||
public BaseResponse<TtsAgent.TtsParseResult> getServiceTimeObj(@ApiParam(value = "待申请时间戳的原文", required = true) @RequestParam(name = "data") String data) {
|
||||
public BaseResponse<TtsAgent.TtsParseResult> getServiceTimeObj(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data") String data) {
|
||||
TimeServiceConstant constant = new TimeServiceConstant();
|
||||
return BaseResponse.success(constant.getServiceTimeObj(data));
|
||||
}
|
||||
@ -52,7 +52,7 @@ public class TiemServiceController {
|
||||
* @return 时间戳对象
|
||||
*/
|
||||
@GetMapping(value = "/getServiceTime")
|
||||
public BaseResponse<String> getServiceTime(@ApiParam(value = "待申请时间戳的原文", required = true) @RequestParam(name = "data") String data) {
|
||||
public BaseResponse<String> getServiceTime(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data") String data) {
|
||||
TimeServiceConstant constant = new TimeServiceConstant();
|
||||
return BaseResponse.success(constant.getServiceTime(data));
|
||||
}
|
||||
|
Reference in New Issue
Block a user