Minor revision.
This commit is contained in:
parent
75c10cb035
commit
7a24532ab7
@ -27,14 +27,14 @@ public class WXBizDataCrypt {
|
|||||||
final byte[] aesCipher = Base64.decodeBase64(encryptedData);
|
final byte[] aesCipher = Base64.decodeBase64(encryptedData);
|
||||||
final byte[] aesIV = Base64.decodeBase64(iv);
|
final byte[] aesIV = Base64.decodeBase64(iv);
|
||||||
|
|
||||||
final byte[] resultByte;
|
final byte[] decryptedBytes;
|
||||||
try {
|
try {
|
||||||
resultByte = AESUtils.decrypt(aesCipher, aesKey, aesIV);
|
decryptedBytes = AESUtils.decrypt(aesCipher, aesKey, aesIV);
|
||||||
} catch (InvalidAlgorithmParameterException e) {
|
} catch (InvalidAlgorithmParameterException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String decryptedText = new String(resultByte, Charset.forName("UTF-8"));
|
final String decryptedText = new String(decryptedBytes, Charset.forName("UTF-8"));
|
||||||
final JSONObject decrypted = JSON.parseObject(decryptedText);
|
final JSONObject decrypted = JSON.parseObject(decryptedText);
|
||||||
|
|
||||||
final String appId = decrypted.getJSONObject("watermark").getString("appid");
|
final String appId = decrypted.getJSONObject("watermark").getString("appid");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user