loadrunner

This commit is contained in:
cheney 2022-05-18 16:46:48 +08:00
parent ca47ba3abc
commit 05489bfdf7
2 changed files with 30 additions and 25 deletions

View File

@ -6,32 +6,35 @@ import racal.sunyard.main.SydApiBuilder;
public class ShangTest { public class ShangTest {
private static final String dn = "C=CN,O=CFCA OCA1,OU=YCCA,OU=Individual-2,CN=YCCA@黄金交易所@Zhuangj@1";
private static final byte[] testData = new byte[ 4 * 1024 ]; private static final byte[] testData = new byte[ 4 * 1024 ];
private SydApi4j api = null; private SydApi4j api = null;
public void init() throws ClassNotFoundException, IllegalAccessException, InstantiationException { public void init() throws Exception {
if ( null == api ) {
api = (SydApi4j) new SydApiBuilder() api = (SydApi4j) new SydApiBuilder()
.setIp("172.16.18.59") .setIp("172.16.18.59") // 192.168.0.162
.setPort( 8889 ) .setPort( 8889 )
.useDebugMode() .useDebugMode()
.build(); .build();
} }
public void hash4(){
api.SM3Hash( testData );
} }
public void fun1(){ public void action(){
// byte[] sign = api.attachedSign(); String sign = api.attachedSign(testData, dn);
boolean ret = api.attachedVerify( sign );
assert ret;
sign = api.SYD_DetachedSign(testData, dn);
ret = api.SYD_DetachedVerify( testData, sign );
assert ret;
} }
public void end(){
public void destroy(){
if (null != this.api ) { if (null != this.api ) {
this.api.disconnect(); this.api.disconnect();
} }
@ -39,11 +42,10 @@ public class ShangTest {
public static void main(String[] args) throws Throwable { public static void main(String[] args) throws Throwable {
System.out.println( SydApi4j.getVersion() ); System.out.println( SydApi4j.getVersion() );
Actions test = new Actions(); // Actions test = new Actions();
ShangTest test = new ShangTest();
test.init(); test.init();
test.action(); test.action();
test.end(); test.end();

View File

@ -17,11 +17,14 @@ public class Actions
private SydApi4j api = null; private SydApi4j api = null;
public int init() throws Throwable { public int init() throws Throwable {
if ( null == api ) {
api = (SydApi4j) new SydApiBuilder() api = (SydApi4j) new SydApiBuilder()
.setIp("172.16.18.59") .setIp("172.16.18.59")
.setPort( 8889 ) .setPort( 8889 )
.useDebugMode() .useDebugMode()
.build(); .build();
}
return 0; return 0;
}//end of init }//end of init