-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weixin.popular.util.WxaUtil类需要加个方法,针对小程序授权手机号转换成手机号信息 #230
Comments
|
`package weixin.popular.bean.wxa; public class WxaUserPhoneInfo {
} |
public static WxaUserPhoneInfo decryptUserPhoneInfo(String session_key, String encryptedData, String iv) { try { Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); Key sKeySpec = new SecretKeySpec(Base64.decodeBase64(session_key), "AES"); cipher.init(Cipher.DECRYPT_MODE, sKeySpec, new IvParameterSpec(Base64.decodeBase64(iv))); byte[] resultByte = cipher.doFinal(Base64.decodeBase64(encryptedData)); String data = new String(PKCS7Encoder.decode(resultByte), StandardCharsets.UTF_8); return JsonUtil.parseObject(data, WxaUserPhoneInfo.class); } catch (Exception e) { logger.error("", e); } return null; }
`package weixin.popular.bean.wxa;
public class WxaUserPhoneInfo {
}
`
The text was updated successfully, but these errors were encountered: