mirror of
https://gitee.com/BDWare/ypk-deploy-tool
synced 2025-01-10 01:44:02 +00:00
sync test case
This commit is contained in:
parent
15e3468f49
commit
8cf51f2ab5
@ -9,7 +9,6 @@ import org.apache.http.entity.mime.MultipartEntityBuilder;
|
|||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.apache.http.impl.client.HttpClients;
|
import org.apache.http.impl.client.HttpClients;
|
||||||
import org.bdware.client.ResultCallback;
|
import org.bdware.client.ResultCallback;
|
||||||
import org.bdware.client.ws.Action;
|
|
||||||
import org.bouncycastle.crypto.CryptoException;
|
import org.bouncycastle.crypto.CryptoException;
|
||||||
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
|
import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
|
||||||
import org.zz.gmhelper.SM2KeyPair;
|
import org.zz.gmhelper.SM2KeyPair;
|
||||||
@ -151,7 +150,6 @@ public class HTTPTool {
|
|||||||
public static void deployUseHttp(DeployConfig config) {
|
public static void deployUseHttp(DeployConfig config) {
|
||||||
String url = "http://%s/Upload?%s&sign=%s";
|
String url = "http://%s/Upload?%s&sign=%s";
|
||||||
File file = new File(config.ypkPath);
|
File file = new File(config.ypkPath);
|
||||||
String path = config.ypkPath;
|
|
||||||
String argWithoutSig = "path=%s&fileName=%s&isPrivate=true&order=%d&count=%d&pubKey=%s";
|
String argWithoutSig = "path=%s&fileName=%s&isPrivate=true&order=%d&count=%d&pubKey=%s";
|
||||||
SM2KeyPair keyPair = SM2KeyPair.fromJson(String.format("{\"publicKey\":\"%s\",\"privateKey\":\"%s\"}", config.publicKey, config.privateKey));
|
SM2KeyPair keyPair = SM2KeyPair.fromJson(String.format("{\"publicKey\":\"%s\",\"privateKey\":\"%s\"}", config.publicKey, config.privateKey));
|
||||||
String pubKey = keyPair.getPublicKeyStr();
|
String pubKey = keyPair.getPublicKeyStr();
|
||||||
@ -181,7 +179,8 @@ public class HTTPTool {
|
|||||||
CloseableHttpResponse response = client.execute(httpPost);
|
CloseableHttpResponse response = client.execute(httpPost);
|
||||||
ByteArrayOutputStream bo = new ByteArrayOutputStream();
|
ByteArrayOutputStream bo = new ByteArrayOutputStream();
|
||||||
response.getEntity().writeTo(bo);
|
response.getEntity().writeTo(bo);
|
||||||
System.out.println(TAG + +order + " " + count + " " + bo);
|
System.out.println(TAG + +order + "/" + count + " " + bo);
|
||||||
|
client.close();
|
||||||
}
|
}
|
||||||
} catch (IOException | CryptoException e) {
|
} catch (IOException | CryptoException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user