Changes
This commit is contained in:
parent
bd3fc80c7f
commit
a16ae83f4d
@ -40,6 +40,10 @@ public class SydApi4Database implements SydApi {
|
|||||||
@Override
|
@Override
|
||||||
public void SYD_Disconnect_Ex() {
|
public void SYD_Disconnect_Ex() {
|
||||||
if (isShortLinkMode) {
|
if (isShortLinkMode) {
|
||||||
|
if ( null == hsms ){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SydApi4j api = hsms[0];
|
SydApi4j api = hsms[0];
|
||||||
if (null != api) {
|
if (null != api) {
|
||||||
try {
|
try {
|
||||||
@ -57,9 +61,6 @@ public class SydApi4Database implements SydApi {
|
|||||||
if (LogFactory.iLogLevel==3) {
|
if (LogFactory.iLogLevel==3) {
|
||||||
log.debug("SYD_SM3_Hash_ShortData方法接收参数:pcData:{}", Arrays.toString(pcData));
|
log.debug("SYD_SM3_Hash_ShortData方法接收参数:pcData:{}", Arrays.toString(pcData));
|
||||||
}
|
}
|
||||||
if (pcData.length==0){
|
|
||||||
throw new SydApiException(-19);
|
|
||||||
}
|
|
||||||
if (null == this.hsms || this.hsms.length < 1) {
|
if (null == this.hsms || this.hsms.length < 1) {
|
||||||
throw new SydApiException(-1);
|
throw new SydApiException(-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public class Sample
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
// 路径要以 / 或 \\ 结尾表示目录
|
// 路径要以 / 或 \\ 结尾表示目录
|
||||||
SydApi.SYD_SetLogConfig("./logs/",3);
|
SydApi.SYD_SetLogConfig("./logs/",1);
|
||||||
|
|
||||||
Logger log = LogFactory.getLogger();
|
Logger log = LogFactory.getLogger();
|
||||||
log.info("start");
|
log.info("start");
|
||||||
@ -373,7 +373,7 @@ public class Sample
|
|||||||
int keyIdx = 0;
|
int keyIdx = 0;
|
||||||
// 测试数据
|
// 测试数据
|
||||||
byte[] data = new byte[16];
|
byte[] data = new byte[16];
|
||||||
byte[] encData = api.SYD_SM4_ShortData( keyIdx , data, Consts.ECB_ENC );
|
byte[] encData = api.SYD_SM4_ShortData( keyIdx , data, Consts.ECB_DEC );
|
||||||
byte[] orgData = api.SYD_SM4_ShortData( keyIdx , encData, Consts.ECB_DEC );
|
byte[] orgData = api.SYD_SM4_ShortData( keyIdx , encData, Consts.ECB_DEC );
|
||||||
System.out.println( "HEX=" + Util.bytes2HexString( encData ) );
|
System.out.println( "HEX=" + Util.bytes2HexString( encData ) );
|
||||||
Assert.assertArrayEquals( orgData, data );
|
Assert.assertArrayEquals( orgData, data );
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user