|
|
|
@ -1,4 +1,4 @@ |
|
|
|
package com.zdxt.code.utils; |
|
|
|
package com.zdxt.common.util; |
|
|
|
|
|
|
|
import cn.hutool.core.codec.Base64; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
@ -6,17 +6,9 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.crypto.SecureUtil; |
|
|
|
import cn.hutool.crypto.asymmetric.KeyType; |
|
|
|
import cn.hutool.crypto.asymmetric.RSA; |
|
|
|
import cn.hutool.crypto.symmetric.SymmetricAlgorithm; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.zdxt.code.utils.HttpUtil; |
|
|
|
|
|
|
|
import java.io.BufferedReader; |
|
|
|
import java.io.DataOutputStream; |
|
|
|
import java.io.InputStreamReader; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.URL; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
@ -38,11 +30,11 @@ public class IdCardCryptoUtil { |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", "1608644307579883522"); |
|
|
|
String userIdCode = IdCardCryptoUtil.symmetricEncryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", "1608644307579883522"); |
|
|
|
String userNameCode = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", "汪鑫"); |
|
|
|
|
|
|
|
// String secret = IdCardCryptoUtil.symmetricEncryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", "ae739d8c-86ed-4898-b57d-eed3be42debf");
|
|
|
|
// String phone = IdCardCryptoUtil.symmetricDecryptIdCard("eWIzY3BMRVNEQXhvUUlXMA==", "0PPEx9wD2DLva7zpWJt8MQ==");
|
|
|
|
String phone = IdCardCryptoUtil.symmetricDecryptIdCard("VRJHzFqJpsSZhwnsKTWNspv_GZMxTWl-bgH6DyE9Ty0", userIdCode); |
|
|
|
|
|
|
|
// System.out.println(userIdCode);
|
|
|
|
// System.out.println(phone);
|
|
|
|
@ -60,9 +52,9 @@ public class IdCardCryptoUtil { |
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
params.put("accessKeySign",secret); |
|
|
|
params.put("appCode","zfjdm"); |
|
|
|
String data = HttpUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/getUserInfo", |
|
|
|
JSONObject.toJSONString(params),new HashMap<>()); |
|
|
|
System.out.println(data); |
|
|
|
// String data = HttpUtil.httpSendPost("http://egbpub.siqhz.com/egb/api/thirdauth/pub/auth/getUserInfo",
|
|
|
|
// JSONObject.toJSONString(params),new HashMap<>());
|
|
|
|
// System.out.println(data);
|
|
|
|
} |
|
|
|
|
|
|
|
|