This commit is contained in:
liulu 2024-10-28 14:47:43 +08:00
parent 80ed3eae1f
commit 69aa6e2bf8
6 changed files with 38 additions and 31 deletions

View File

@ -28,10 +28,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>

View File

@ -14,6 +14,7 @@ import java.util.Objects;
@AllArgsConstructor @AllArgsConstructor
public enum KeyAlg { public enum KeyAlg {
SM1(KeyCategory.SYM_KEY, "SM1", "国密SM1"),
SM4(KeyCategory.SYM_KEY, "SM4", "国密SM4"), SM4(KeyCategory.SYM_KEY, "SM4", "国密SM4"),
SM2(KeyCategory.ASYM_KEY, "SM2", "国密SM2"), SM2(KeyCategory.ASYM_KEY, "SM2", "国密SM2"),
; ;

View File

@ -19,6 +19,15 @@
<dependencies> <dependencies>
<dependency>
<groupId>com.sunyard.chsm</groupId>
<artifactId>chsm-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-security</artifactId>
@ -40,16 +49,9 @@
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.sunyard.chsm</groupId>
<artifactId>chsm-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.dm</groupId> <groupId>com.dm</groupId>
<artifactId>DmJdbcDriver</artifactId> <artifactId>DmJdbcDriver</artifactId>
<version>1.8</version>
</dependency> </dependency>
<!-- sunyard --> <!-- sunyard -->
@ -58,24 +60,12 @@
<artifactId>ssp.javasdk</artifactId> <artifactId>ssp.javasdk</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.sunyard</groupId>
<artifactId>sdf1418</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sunyard</groupId>
<artifactId>sydapi4j</artifactId>
<version>1.13.20221010</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 工具包 --> <!-- 工具包 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId> <artifactId>commons-pool2</artifactId>
@ -92,12 +82,12 @@
<dependency> <dependency>
<groupId>net.java.dev.jna</groupId> <groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId> <artifactId>jna</artifactId>
<version>5.5.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>1.5.13</version> <version>1.5.13</version>
<scope>provided</scope>
</dependency> </dependency>
@ -120,7 +110,6 @@
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId> <artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.persistence</groupId> <groupId>javax.persistence</groupId>

View File

@ -47,6 +47,7 @@ public class WebConfig {
loggingFilter.setIncludeQueryString(true); loggingFilter.setIncludeQueryString(true);
loggingFilter.setIncludePayload(true); loggingFilter.setIncludePayload(true);
loggingFilter.setMaxPayloadLength(2000); loggingFilter.setMaxPayloadLength(2000);
loggingFilter.setBeforeMessagePrefix("http request [");
return loggingFilter; return loggingFilter;
} }

View File

@ -2,7 +2,6 @@ package com.sunyard.ssp.modules.sysconf.cipherunit.controller;
import com.sun.jna.Pointer; import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference; import com.sun.jna.ptr.PointerByReference;
import com.sunyard.proto.Util;
import com.sunyard.ssp.common.Result; import com.sunyard.ssp.common.Result;
import com.sunyard.ssp.common.annotation.AuditControllerLog; import com.sunyard.ssp.common.annotation.AuditControllerLog;
import com.sunyard.ssp.common.exception.SspwebException; import com.sunyard.ssp.common.exception.SspwebException;
@ -18,6 +17,7 @@ import com.sunyard.ssp.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Hex;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -97,7 +97,7 @@ public class ScCipherMachineController {
return new ResultUtil<Object>().setErrorMsg(ret, "生成随机数失败,密码模块初始化失败"); return new ResultUtil<Object>().setErrorMsg(ret, "生成随机数失败,密码模块初始化失败");
} }
// 返回结果 // 返回结果
String result = Util.bytes2HexString(nakedSign); String result = Hex.encodeHexString(nakedSign);
log.info("检测功能响应结果:{}", result); log.info("检测功能响应结果:{}", result);
return new ResultUtil<>().setData(result); return new ResultUtil<>().setData(result);
} catch (SspwebException e) { } catch (SspwebException e) {

20
pom.xml
View File

@ -53,6 +53,26 @@
<artifactId>proto</artifactId> <artifactId>proto</artifactId>
<version>1.0.20221215</version> <version>1.0.20221215</version>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.8.4</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>com.dm</groupId>
<artifactId>DmJdbcDriver</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>