添加 SM3 接口变种
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.sunyard.sydapi.test;
|
||||
|
||||
|
||||
import com.sunyard.proto.Util;
|
||||
import racal.sunyard.main.SydApi4j;
|
||||
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public class TestSM3PK {
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
|
||||
SydApi4j.SYD_Set_Parameter_HA("unkown", "192.168.0.200", 8889, 1000);
|
||||
|
||||
SydApi4j api = (SydApi4j) new SydApi4j();//.connect("wuyong.fullstack.club" , 8889, null,1000);
|
||||
String certId = "4008258105";
|
||||
try {
|
||||
// "03420004" +
|
||||
String pk = "034200043c59ccb2c52e034337fad49eca0095587eb40e24ffc642d07e0c911ea4a3b0e94f11b92b51047f6f75badf5ab2fc2e15ba4dfddf95869d4fa8d8852dea811d4b";
|
||||
|
||||
byte[] ret = api.SM3Hash(pk, certId, Util.hexString2Bytes("636572745F69643D3430303832353831303526636F64653D3430303034266D73673DE7BCBAE5B091E5BF85E98089E58F82E695B0267369676E5F747970653D534D32267375625F636F64653D75702E6D697373696E672D6F72672D706964267375625F6D73673DE7BCBAE5B0916F72675F706964205B5550303231303031325D"));
|
||||
|
||||
System.out.println( Util.bytes2HexString( ret ) );
|
||||
} finally {
|
||||
api.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user