应该使用Throwable 进行异常捕获
byte[] cer = Base64.decode(cert);
try {
int ret = TafLibrary.getInstance().Taf_VerifyKeyUsage(cer, cer.length);
if (ret != 0) {
log.info("验证签名证书密钥用法失败!");
throw new SysException(RetExceptionCodes.FAILED_CERT_KEY_VERIFY);
}
} catch (Throwable e) {
log.error("验证签名证书密钥用法异常! 请查看是否为so库无法加载!"+e.getMessage());
throw new SysException(RetExceptionCodes.FAILED_CERT_KEY_VERIFY);
}
log.info("验证签名证书密钥用法成功.");
评论区