|
|
@@ -14,15 +14,14 @@ import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
|
14
|
14
|
import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
|
|
15
|
15
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
|
16
|
16
|
import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
|
|
|
17
|
+
|
|
17
|
18
|
import com.tencentcloudapi.common.Credential;
|
|
18
|
|
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
19
|
19
|
import com.tencentcloudapi.common.profile.ClientProfile;
|
|
20
|
20
|
import com.tencentcloudapi.common.profile.HttpProfile;
|
|
|
21
|
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
21
|
22
|
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
|
|
22
|
|
-import com.tencentcloudapi.faceid.v20180301.models.GetEidResultRequest;
|
|
23
|
|
-import com.tencentcloudapi.faceid.v20180301.models.GetEidResultResponse;
|
|
24
|
|
-import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenRequest;
|
|
25
|
|
-import com.tencentcloudapi.faceid.v20180301.models.GetEidTokenResponse;
|
|
|
23
|
+import com.tencentcloudapi.faceid.v20180301.models.*;
|
|
|
24
|
+
|
|
26
|
25
|
import org.slf4j.Logger;
|
|
27
|
26
|
import org.slf4j.LoggerFactory;
|
|
28
|
27
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -134,14 +133,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
|
134
|
133
|
IdentityAuthenticationRespon.setUserId(userId);
|
|
135
|
134
|
|
|
136
|
135
|
JSONObject objEidInfo = JSON.parseObject(objJSON.getString("EidInfo"));
|
|
137
|
|
- String desKey = objEidInfo.getString("DesKey");
|
|
138
|
|
- String uerInfo = objEidInfo.getString("UserInfo");
|
|
139
|
|
- Map<String,String> mapEidInfo = decodeEidInfo(desKey,uerInfo);
|
|
140
|
|
- IdentityAuthenticationRespon.setName(mapEidInfo.get("name"));
|
|
141
|
|
- IdentityAuthenticationRespon.setIdentityNo(mapEidInfo.get("identityNo"));
|
|
142
|
|
- IdentityAuthenticationRespon.setCertificationStatus(1);
|
|
143
|
|
-
|
|
144
|
|
- identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
|
|
|
136
|
+// identityAuthenticationMapper.insertIdentityAuthentication(IdentityAuthenticationRespon);
|
|
145
|
137
|
IdentityAuthenticationResult.setCertificationStatus(1);
|
|
146
|
138
|
IdentityAuthenticationResult.setCertificationStatusName("认证成功");
|
|
147
|
139
|
} catch (TencentCloudSDKException e) {
|
|
|
@@ -153,23 +145,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthenticatio
|
|
153
|
145
|
return IdentityAuthenticationResult;
|
|
154
|
146
|
}
|
|
155
|
147
|
|
|
156
|
|
- private Map<String, String> decodeEidInfo(String desKey, String uerInfo) {
|
|
157
|
|
- Map<String, String> mapEidInfo = new HashMap<>();
|
|
158
|
|
- byte[] deskeybyts = Base64.getDecoder().decode(desKey);
|
|
159
|
|
- final SM2 sm2crypt = new SM2(privateKeyHexDecodeinfo, null, null);
|
|
160
|
|
- sm2crypt.usePlainEncoding();
|
|
161
|
|
- byte[] sm4keybys = sm2crypt.decrypt(deskeybyts);
|
|
162
|
|
- SymmetricCrypto sm4dcrypt = SmUtil.sm4(sm4keybys);
|
|
163
|
|
- byte[] uerInfobytes = sm4dcrypt.decrypt(Base64.getDecoder().decode(uerInfo));
|
|
164
|
|
- JSONObject objuerInfo = JSON.parseObject(new String(uerInfobytes));
|
|
165
|
|
- String name = objuerInfo.getString("name");
|
|
166
|
|
- mapEidInfo.put("name",name);
|
|
167
|
|
- String idtype = objuerInfo.getString("idtype");
|
|
168
|
|
- mapEidInfo.put("identitytype",idtype);
|
|
169
|
|
- String idnum = objuerInfo.getString("idnum");
|
|
170
|
|
- mapEidInfo.put("identityNo",idnum);
|
|
171
|
|
- return mapEidInfo;
|
|
172
|
|
- }
|
|
|
148
|
+
|
|
|
149
|
+
|
|
|
150
|
+
|
|
|
151
|
+
|
|
|
152
|
+
|
|
173
|
153
|
|
|
174
|
154
|
|
|
175
|
155
|
}
|