小数据测试通过
This commit is contained in:
parent
02fd07def2
commit
0dc2d7c026
@ -7059,6 +7059,7 @@ public class SydApi4j implements SydApi {
|
||||
bb.put((byte) dataType);
|
||||
|
||||
if (dataType == 2) { // 私钥
|
||||
bb.put("999999999999999999999999999".getBytes());
|
||||
bb.put(ByteUtil.shortToBytes((short) privateKey.length, ByteOrder.BIG_ENDIAN));
|
||||
bb.put(privateKey);
|
||||
}
|
||||
|
||||
@ -99,8 +99,9 @@ public class FunctionTest {
|
||||
@Test
|
||||
public void SYD_SM2_Encrypt(){
|
||||
byte[] enData = this.api.SYD_SM2Encrypt(publicKey4Ende, orgData);
|
||||
// byte[] deData = this.api.SYD_SM2Decrypt(publicKey4Ende, enData);
|
||||
// Assert.assertArrayEquals(enData, deData);
|
||||
System.out.println("密文=" + Util.bytes2HexString(enData));
|
||||
byte[] deData = this.api.SYD_SM2Decrypt(privateKey4Ende, enData);
|
||||
Assert.assertArrayEquals(orgData, deData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user