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