ylx 7 anos atrás
pai
commit
61b9b1d29e

+ 8 - 4
saicLogistics/src/main/java/com/fuzamei/util/blockchain/KeyUtils.java

@@ -93,13 +93,17 @@ public class KeyUtils {
 		String result = BlockChainUtil.sendPostParam(protobufBean);
 		System.out.println(result);*/
     	
-    	long Uid = 23233L;
-    	String random = "caoXSy856H";
-    	String publicKey = getPublicKey(getPrivateKey("123456", random));
-    	System.out.println(publicKey);
+//    	long Uid = 23233L;
+//    	String random = "caoXSy856h";
+//    	String publicKey = getPublicKey(getPrivateKey("123456", random));
+//    	System.out.println(publicKey);
 //    	ProtobufBean protobufBean = ProtobufUtils.requestUserCreate(Uid,publicKey);
 //    	String result = BlockChainUtil.sendPostParam(protobufBean);
 //		System.out.println(result);
+    	
+    	
+    	String hexString2String = HexUtil.hexString2String("75736572206E6F74206578697374");
+    	System.out.println(hexString2String);
 		
 		/** 先平台初始化  **/
 		/*ProtobufBean protobufBean = ProtobufUtils.initPlatform();	

+ 4 - 4
saicLogistics/src/main/java/com/fuzamei/util/blockchain/ProtobufUtils.java

@@ -117,7 +117,7 @@ public class ProtobufUtils {
             String signdateBase64 = encodeBase64(requestByte);
             protobufBean.setSignature(signdateBase64);
         } catch (Exception e) {
-            throw new RuntimeException("生成签名对象出现异常");
+            throw new RuntimeException(e);
         }
         return protobufBean;
     }
@@ -132,11 +132,11 @@ public class ProtobufUtils {
             sgr.update(requestByte);
             signbyte = sgr.sign();
         } catch (NoSuchAlgorithmException e) {
-            e.printStackTrace();
+        	throw new RuntimeException(e);
         } catch (SignatureException e) {
-            e.printStackTrace();
+        	throw new RuntimeException(e);
         } catch (InvalidKeyException e) {
-            e.printStackTrace();
+        	throw new RuntimeException(e);
         }
         return ByteString.copyFrom(signbyte,0,64);
     }