增加大数据裸签功能,完善RSA签名功能接口(修改counthash使用)
This commit is contained in:
@@ -21,10 +21,12 @@ import java.util.List;
|
||||
import static com.sunyard.sydapi.util.PrintUtil.printRetWrap;
|
||||
|
||||
public class Shanghairenhang {
|
||||
private static final byte[] orgData2k = new byte[ 1*1024 ];
|
||||
private static final byte[] orgData2k = new byte[ 2000*1024 ];
|
||||
private static final String pcDnEN = "C=CN,O=CFCA OCA1,OU=YCCA,OU=Individual-2,CN=YCCA@黄金交易所@Zhuangj@1";
|
||||
private static final String RSA = "C=cn,O=CFCA TEST CA,OU=NCS2,OU=Enterprises,CN=041@Z402451000010@ShanDong@00000001";
|
||||
|
||||
private static final String RSA2 = "C=CN,O=sunyard,OU=rsa,CN=javaRsa";
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException, CertificateException, NoSuchProviderException {
|
||||
// System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
long startTime = System.currentTimeMillis(); //获取开始时间
|
||||
@@ -81,20 +83,23 @@ public class Shanghairenhang {
|
||||
@Test
|
||||
public void testRenhang() throws UnsupportedEncodingException {
|
||||
//System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
SydApiBuilder builder = new SydApiBuilder().setIp("192.168.0.200");
|
||||
SydApiBuilder builder = new SydApiBuilder().setIp("172.16.17.161");
|
||||
SydApi4j api = (SydApi4j) builder.build();
|
||||
// String attachedSign = api.attachedSign(2,orgData2k, RSA);
|
||||
// System.out.println(attachedSign);
|
||||
// boolean attachedVerify = api.attachedVerify(2,attachedSign);
|
||||
// System.out.println(attachedVerify);
|
||||
String attachedSign = api.attachedSign(2,orgData2k, RSA2);
|
||||
System.out.println(attachedSign);
|
||||
boolean attachedVerify = api.attachedVerify(2,attachedSign);
|
||||
System.out.println(attachedVerify);
|
||||
// byte[] hash = api.RSAHash(2, orgData2k);
|
||||
// System.out.println(Util.bytes2HexString(hash));
|
||||
|
||||
byte[] bytes = api.SYD_NakedSign(orgData2k, pcDnEN);
|
||||
System.out.println(Util.bytes2HexString(bytes));
|
||||
|
||||
// byte[] bytes = api.SYD_NakedSign(orgData2k, pcDnEN);
|
||||
// System.out.println(Util.bytes2HexString(bytes));
|
||||
}
|
||||
@Test
|
||||
public void aboutCert() throws UnsupportedEncodingException {
|
||||
//System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
SydApiBuilder builder = new SydApiBuilder().setIp("192.168.1.129");
|
||||
SydApiBuilder builder = new SydApiBuilder().setIp("192.168.1.100");
|
||||
SydApi4j api = (SydApi4j) builder.build();
|
||||
RetWrap allCert = api.getAllCert(0);
|
||||
printRetWrap(allCert);
|
||||
@@ -106,4 +111,19 @@ public class Shanghairenhang {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nakedsign(){
|
||||
// System.setProperty("com.sunyard.sydapi4j.debug", "true");
|
||||
SydApiBuilder builder = new SydApiBuilder().setIp("172.16.17.161");
|
||||
SydApi4j api = (SydApi4j) builder.build();
|
||||
|
||||
|
||||
byte[] nakedSign2 = api.SYD_NakedSign(orgData2k, pcDnEN);
|
||||
System.out.println("大数据裸签:"+ Util.bytes2HexString(nakedSign2));
|
||||
boolean nakedVerify2 = api.SYD_NakedVerify(orgData2k, nakedSign2, pcDnEN);
|
||||
System.out.println("大数据验签:"+nakedVerify2 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user