mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
system微服务util单元测试完善
This commit is contained in:
+17
-17
@@ -80,23 +80,23 @@ public class AsymmetricAlgorithmUtil {
|
||||
return keys;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
LinkedList<String> priKeyAndPubKey = AsymmetricAlgorithmUtil.getPriKeyAndPubKey();
|
||||
String privateKey = priKeyAndPubKey.get(0);
|
||||
String publicKey = priKeyAndPubKey.get(1);
|
||||
String text = "HelloWorld";
|
||||
|
||||
String encryptByPublic = AsymmetricAlgorithmUtil.encryptByPublic(text, publicKey);
|
||||
System.out.println(encryptByPublic);
|
||||
String s = AsymmetricAlgorithmUtil.decryptByPrivate(encryptByPublic, privateKey);
|
||||
System.out.println("公钥加密私钥解密:"+s);
|
||||
|
||||
String encryptByPrivate = AsymmetricAlgorithmUtil.encryptByPrivate(text, privateKey);
|
||||
System.out.println(encryptByPrivate);
|
||||
String s1 = AsymmetricAlgorithmUtil.decryptByPublic(encryptByPrivate,publicKey);
|
||||
System.out.println("私钥加密公钥解密:"+s1);
|
||||
}
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// LinkedList<String> priKeyAndPubKey = AsymmetricAlgorithmUtil.getPriKeyAndPubKey();
|
||||
// String privateKey = priKeyAndPubKey.get(0);
|
||||
// String publicKey = priKeyAndPubKey.get(1);
|
||||
// String text = "HelloWorld";
|
||||
//
|
||||
// String encryptByPublic = AsymmetricAlgorithmUtil.encryptByPublic(text, publicKey);
|
||||
// System.out.println(encryptByPublic);
|
||||
// String s = AsymmetricAlgorithmUtil.decryptByPrivate(encryptByPublic, privateKey);
|
||||
// System.out.println("公钥加密私钥解密:"+s);
|
||||
//
|
||||
// String encryptByPrivate = AsymmetricAlgorithmUtil.encryptByPrivate(text, privateKey);
|
||||
// System.out.println(encryptByPrivate);
|
||||
// String s1 = AsymmetricAlgorithmUtil.decryptByPublic(encryptByPrivate,publicKey);
|
||||
// System.out.println("私钥加密公钥解密:"+s1);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user