申请时间戳异常 不提示

This commit is contained in:
zhangqinbin
2022-08-04 17:20:57 +08:00
parent bd67db61ac
commit d87cfa4ddb

View File

@ -41,7 +41,7 @@ public class TimeServiceConstant {
// 获得TSAClient // 获得TSAClient
client = (TSAClient) factory.getTSAClient(); client = (TSAClient) factory.getTSAClient();
} catch (Exception e) { } catch (Exception e) {
log.error("读取配置文件或连接时间戳服务器异常", e); log.error("读取配置文件或连接时间戳服务器异常", e.getMessage());
} }
} }
@ -67,7 +67,7 @@ public class TimeServiceConstant {
log.info("timestamp -->" + timestamp); log.info("timestamp -->" + timestamp);
return timestamp; return timestamp;
} catch (Exception e) { } catch (Exception e) {
log.error("申请时间戳异常", e); log.error("申请时间戳异常", e.getMessage());
} }
return ""; return "";
} }
@ -92,7 +92,7 @@ public class TimeServiceConstant {
ttsParseResult = new TtsAgent.TtsParseResult(time, HelperUtil.bytesToHexString(verifyResult.getData()), ttsParseResult = new TtsAgent.TtsParseResult(time, HelperUtil.bytesToHexString(verifyResult.getData()),
verifyResult.getSignerSubject()); verifyResult.getSignerSubject());
} catch (Exception e) { } catch (Exception e) {
log.error("解析时间戳", e); log.error("解析时间戳", e.getMessage());
} }
return ttsParseResult; return ttsParseResult;
} }
@ -105,7 +105,7 @@ public class TimeServiceConstant {
TSAVerifyResult verifyResult = client.verifyTimeStamp(Base64.decodeBase64(timestamp)); TSAVerifyResult verifyResult = client.verifyTimeStamp(Base64.decodeBase64(timestamp));
return verifyResult; return verifyResult;
} catch (Exception e) { } catch (Exception e) {
log.error("解析时间戳", e); log.error("解析时间戳", e.getMessage());
} }
return null; return null;
} }
@ -127,7 +127,7 @@ public class TimeServiceConstant {
String timestamp = this.signTimeStamp(data); String timestamp = this.signTimeStamp(data);
ttsParseResult = this.verifyTimeStamp2(timestamp); ttsParseResult = this.verifyTimeStamp2(timestamp);
} catch (Exception e) { } catch (Exception e) {
log.error("获取时间戳异常", e); log.error("获取时间戳异常", e.getMessage());
} }
return ttsParseResult; return ttsParseResult;
} }
@ -150,7 +150,7 @@ public class TimeServiceConstant {
TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp);
time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(verifyResult.getSignedTime()); time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(verifyResult.getSignedTime());
} catch (Exception e) { } catch (Exception e) {
log.error("获取时间戳异常", e); log.error("获取时间戳异常", e.getMessage());
} }
return time; return time;
} }
@ -173,7 +173,7 @@ public class TimeServiceConstant {
Date date = verifyResult.getSignedTime(); Date date = verifyResult.getSignedTime();
return date; return date;
} catch (Exception e) { } catch (Exception e) {
log.error("获取时间戳异常", e); log.error("获取时间戳异常", e.getMessage());
} }
return new Date(); return new Date();
} }
@ -203,7 +203,7 @@ public class TimeServiceConstant {
date = verifyResult.getSignedTime(); date = verifyResult.getSignedTime();
} catch (Exception e) { } catch (Exception e) {
log.error("获取时间戳异常", e); log.error("获取时间戳异常", e.getMessage());
} }
SystemTime systemTime = new SystemTime() SystemTime systemTime = new SystemTime()
.setYear(date.getYear() + 1900) .setYear(date.getYear() + 1900)