fix
This commit is contained in:
parent
5ce75ed4ce
commit
84aaa824c5
@ -31,7 +31,7 @@ public abstract class JnaSdfAdaptor implements SdfApiAdapter {
|
|||||||
|
|
||||||
protected final SdfLibrary sdfLibrary;
|
protected final SdfLibrary sdfLibrary;
|
||||||
|
|
||||||
protected abstract int getAlgId(String alg);
|
protected abstract int getAlgId(AlgId alg);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String openDevice() {
|
public String openDevice() {
|
||||||
|
@ -2,6 +2,7 @@ package com.sunyard.chsm.sdf.adapter;
|
|||||||
|
|
||||||
import com.sun.jna.Native;
|
import com.sun.jna.Native;
|
||||||
import com.sun.jna.ptr.PointerByReference;
|
import com.sun.jna.ptr.PointerByReference;
|
||||||
|
import com.sunyard.chsm.sdf.context.AlgId;
|
||||||
import com.sunyard.chsm.sdf.context.SunyardAlgId;
|
import com.sunyard.chsm.sdf.context.SunyardAlgId;
|
||||||
import com.sunyard.chsm.sdf.lib.SunyardSdfLibrary;
|
import com.sunyard.chsm.sdf.lib.SunyardSdfLibrary;
|
||||||
|
|
||||||
@ -50,8 +51,8 @@ public class SunyardJnaSdfAdaptor extends JnaSdfAdaptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getAlgId(String alg) {
|
protected int getAlgId(AlgId alg) {
|
||||||
return SunyardAlgId.valueOf(alg).getValue();
|
return SunyardAlgId.valueOf(alg.name()).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] safeStringBytes(String str) {
|
public static byte[] safeStringBytes(String str) {
|
||||||
|
@ -4,15 +4,15 @@ package com.sunyard.chsm.sdf.context;
|
|||||||
* @author liulu
|
* @author liulu
|
||||||
* @since 2024/11/5
|
* @since 2024/11/5
|
||||||
*/
|
*/
|
||||||
public interface AlgId {
|
public enum AlgId {
|
||||||
|
SGD_SM3,
|
||||||
|
|
||||||
String SGD_SM3 = "SGD_SM3";
|
SGD_SM4_CBC,
|
||||||
|
SGD_SM4_ECB,
|
||||||
|
SGD_SM4_MAC,
|
||||||
|
|
||||||
String SGD_SM4_CBC = "SGD_SMS4_CBC";
|
SGD_SM2_1,// 签名验签
|
||||||
String SGD_SM4_ECB = "SGD_SMS4_ECB";
|
SGD_SM2_2,
|
||||||
String SGD_SM4_MAC = "SGD_SMS4_MAC";
|
SGD_SM2_3,// 加密解密
|
||||||
|
;
|
||||||
String SGD_SM2_1 = "SGD_SM2_1"; // 签名验签
|
|
||||||
String SGD_SM2_2 = "SGD_SM2_2";
|
|
||||||
String SGD_SM2_3 = "SGD_SM2_3"; // 加密解密
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.sun.jna.Pointer;
|
|
||||||
import com.sunyard.ssp.common.Result;
|
import com.sunyard.ssp.common.Result;
|
||||||
import com.sunyard.ssp.constv.Alg;
|
import com.sunyard.ssp.constv.Alg;
|
||||||
import com.sunyard.ssp.modules.monitor.log.entity.AuditLog;
|
import com.sunyard.ssp.modules.monitor.log.entity.AuditLog;
|
||||||
@ -90,7 +89,6 @@ public class ScUShieldController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IParamConfService iParamConfService;
|
private IParamConfService iParamConfService;
|
||||||
Pointer hDeviceHandle = null;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SdkApiService sdkApiService;
|
private SdkApiService sdkApiService;
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
port: 89
|
port: 8900
|
||||||
tomcat:
|
tomcat:
|
||||||
uri-encoding: UTF-8
|
uri-encoding: UTF-8
|
||||||
threads:
|
threads:
|
||||||
|
Loading…
Reference in New Issue
Block a user