| | |
| | | * @param sessionKey |
| | | * @param iv |
| | | * @return |
| | | * |
| | | */ |
| | | /** |
| | | * 解决java不支持AES/CBC/PKCS7Padding模式解密 |
| | | */ |
| | | static { |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | } |
| | | |
| | | public static JSONObject decryptionUserInfo(String encryptedData, String sessionKey, String iv) { |
| | | // 被加密的数据 |
| | | byte[] dataByte = Base64.decode(encryptedData); |
| | |
| | | } |
| | | // 初始化 |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | /** |
| | | * 解决java不支持AES/CBC/PKCS7Padding模式解密 |
| | | */ |
| | | |
| | | Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding", "BC"); |
| | | SecretKeySpec spec = new SecretKeySpec(keyByte, "AES"); |
| | | AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES"); |
| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 发送https请求 |
| | | * |