|
@@ -1,5 +1,6 @@
|
|
|
package com.zhongshu.payment.server.core.utils;
|
|
package com.zhongshu.payment.server.core.utils;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.crypto.SmUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.util.StopWatch;
|
|
import org.springframework.util.StopWatch;
|
|
@@ -26,6 +27,10 @@ public class TestSM2 {
|
|
|
System.out.println("未加密密码:" + pwd);
|
|
System.out.println("未加密密码:" + pwd);
|
|
|
String[] sm2Keys = Sm2Util.getSm2Keys(false);
|
|
String[] sm2Keys = Sm2Util.getSm2Keys(false);
|
|
|
String pubKey = sm2Keys[0];
|
|
String pubKey = sm2Keys[0];
|
|
|
|
|
+ String publicKeyString = "GAhPWQ8D4hXanneneaydaHYHiwn64p7y3A46Jpss87aKWsy5";
|
|
|
|
|
+ String sm3 = SmUtil.sm3(publicKeyString);
|
|
|
|
|
+// pubKey = sm3;
|
|
|
|
|
+
|
|
|
System.out.println("公钥:" + pubKey);
|
|
System.out.println("公钥:" + pubKey);
|
|
|
System.out.println("公钥base64:" + AesUtils.base64Encode(pubKey));
|
|
System.out.println("公钥base64:" + AesUtils.base64Encode(pubKey));
|
|
|
String priKey = sm2Keys[1];
|
|
String priKey = sm2Keys[1];
|