package com.tax.sign.service;

import com.simple.tool.sign.factory.EncryptFactory;
import com.simple.tool.sign.factory.IHttpRequest;
import com.simple.tool.sign.factory.MyHttpRequestImpl;
import com.simple.tool.sign.util.RSAEncrypt;

public class Test {

	public static void main(String[] args) {
		String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJdjqd2IwkTvAXSqD16ZVCKTsWcIGJ0KvxX7Ib/76I38LBXRF97zXCeODYjbedsslW5PrdjVPjHZ602vnwFMe7OsJHLyCPcc9pLQZIa6I3sRYjWzQGDo3vye9K0/F6KfIPxCHcGpr7lnTXids6qfbSRbh3d58sB4jsDrJza4w+9/AgMBAAECgYA7mr7HfU/Xqi5ti4NPoJjSoEnJohNmyVNgySaJmxn9xRpqYI/AdRqEbFaB2r/Ifm47J13wME0zfXQ6evnkngNZp/MGyPogUqxblJilffGFKT6NJpNtddTVyQIDkEhQ7p4Uq++t08KXvUIFlms6MCLhVFfCkT0MuS9TRgCKAjv3GQJBANN9Jhwy23pPpARfQaLzO+B21LtbmxN+B1BWKUgjN/y01sOEOs84B32f/wQLLqd9p0s+/JPu3LOFzByArYGTEfMCQQC3QGYVxTBpoKFXc+HDJ5q1LvqRratcYBQ7wsCe53eSkWsDWn+5u6GahxS8UzlpohuD0OtHAofn4NHpIeXNvMNFAkAhb2KsCJpMPvUGP+0Hjv7DYOYG7NeagE01tTl3jyHV0N03Mdt+UTRV9wqBICdzEVl2evHBjXzU4O1BAFLt7ktjAkAere1pX6YHSRk55vC5F3xTMRZKJWU3Be7dQnG1KNNf+nCMEy6nDb60fEEAdn56LOWmX+fD76yJKZ57BW3Pz/ZxAkEAlpR/1XUyAmo71OAQFd3qQu367QY/F/pmV/1a4zJNJWFZXbjudP7GcFWsSkPnechamMCfzHNTqbOYn92aK804yA==";

		try {
			
			EncryptFactory encrypt = EncryptFactory.getInstance();
			String a = "12344";
			String b = "1~3~2~~1~0~0~0~0~0~0~92649fee-087d-4054-a5a9-f9c68457fe0c@@12344@@03";
			String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXY6ndiMJE7wF0qg9emVQik7FnCBidCr8V+yG/++iN/CwV0Rfe81wnjg2I23nbLJVuT63Y1T4x2etNr58BTHuzrCRy8gj3HPaS0GSGuiN7EWI1s0Bg6N78nvStPxeinyD8Qh3Bqa+5Z014nbOqn20kW4d3efLAeI7A6yc2uMPvfwIDAQAB";
			
			IHttpRequest request = new MyHttpRequestImpl();
			request.setRequestURI("NSbsqWW/dkgx.do");
			request.setParameter("id", "dkgxquery");
			request.setParameter("fpzt", "0");
			
			System.out.println(encrypt.getResultStr(a, b, request,"1.0"));//旧版本
			
			System.out.println("---------------------------------");
			String result = encrypt.getResultStr(a, b, request,"2.0");//新版本
			System.out.println(result);
			
			System.out.println("---------------------------------");
			
			System.out.println(encrypt.getSuperStr(a, b));//超签，签名服务调用这个
			
			
			
			result = RSAEncrypt.decrypt(result, privateKey);
			System.out.println(result);//12a6eac72a6cdc1706b7892dca9bffbe
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
