整理依赖
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.sunyard.sydapi.test;
|
||||
|
||||
import com.sunyard.util.SYMUtil;
|
||||
|
||||
public class TestClass implements TestInf{
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
|
||||
System.out.println( "class=" + TestClass.class.getName() );
|
||||
System.out.println( "classloader" + TestClass.class.getClassLoader().getClass().getName() );
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.sunyard.sydapi.test;
|
||||
|
||||
|
||||
import com.sunyard.SydApi;
|
||||
import com.sunyard.proto.Util;
|
||||
import racal.sunyard.main.SydApi4j;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
|
||||
public class TestDecryptDataWithFile
|
||||
@@ -14,33 +13,28 @@ public class TestDecryptDataWithFile
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
System.out.println("SydApi 测试程序启动");
|
||||
SydApi key = new SydApi4j().connect("172.16.18.74",8889,null,10000);
|
||||
SydApi key = new SydApi4j().connect("192.168.0.71",8889,null,10000);
|
||||
System.out.println("连接成功");
|
||||
|
||||
long startTime = System.currentTimeMillis(); //获取开始时间
|
||||
String seesionKey = "X246F7CEC2EF09A7A8F0475C6B1CE4B05";
|
||||
String inputPath = "c:\\Users\\KJ-Z285\\Desktop\\dataEncrypt.txt";
|
||||
String outputPath = "c:\\Users\\KJ-Z285\\Desktop\\dataDncrypt.txt";
|
||||
|
||||
byte[] bytes = Util.hexString2Bytes("CBB5DF1ECDB7564EFDA62076632F459BD8F618DC060A5AC368848C5A1D78A85CAFA26F8228F446E2ABA5AEA8F32CF91B606CFD2125766DD3A4E47F4DD22D3A198C2000E9C6F1B73FA33BFE13A00D3612DC9D7C2811A7C1ABAEDBAEEBE8E18D9A2CD670A2526E98C50C4F9205FDE32162E7C8583154D5DDEF2D1B71C6C1636F684BCF865A8EC852C389DEB381728806AC5659E7980651528C0B6F86A47881A66F2C21317D778253786765D60EAA73BC7C6C4CE658BB5231A4FE7282646B0DC774E0B56E38DA29FBA654DB6973661BC65227751E98AB2DD1EBB8076E32D1DB8712");
|
||||
System.out.println("[Tips]:" + "正在解密,请稍候...\n" );
|
||||
|
||||
|
||||
String inputPath = "c:\\Users\\MrYang\\Desktop\\dataEncrypt.txt";
|
||||
String outputPath = "c:\\Users\\MrYang\\Desktop\\dataDncrypt.txt";
|
||||
try {
|
||||
FileOutputStream fileWriter =new FileOutputStream(inputPath);
|
||||
fileWriter.write(bytes);
|
||||
fileWriter.flush();
|
||||
fileWriter.close();
|
||||
}catch (IOException e){
|
||||
e.printStackTrace();
|
||||
if (!key.SYMDecryptDataWithFile(0x01, seesionKey, inputPath, outputPath))
|
||||
{
|
||||
System.out.println("[Error]:" + "解密失败!\n" );
|
||||
}
|
||||
|
||||
System.out.println("[Tips]:" + "解密完成!\n" );
|
||||
|
||||
key.SYMDecryptDataWithFile(1, "X246F7CEC2EF09A7A8F0475C6B1CE4B05", inputPath, outputPath);
|
||||
|
||||
long endTime=System.currentTimeMillis(); //获取结束时间
|
||||
System.out.println("程序运行时间: "+(endTime-startTime)+"ms");
|
||||
|
||||
System.out.println("执行结束\n\n" );
|
||||
key.disconnect();
|
||||
//
|
||||
// Scanner scanner = new Scanner(System.in);
|
||||
// String in = scanner.nextLine();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.sunyard.sydapi.test;
|
||||
|
||||
public interface TestInf {
|
||||
public void run();
|
||||
}
|
||||
Reference in New Issue
Block a user