String url ="https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET
&js_code=JSCODE&grant_type=authorization_code";
String reponse = HTTPSClient.doPost(url, “”, “UTF-8”, 3000, 3000);
JsonObject json = new Gson().fromJson(reponse, JsonObject.class);
String renStr =json.get(“session_key”).getAsString();
String rawData = map.get(“rawData”).toString();
String encryptedData = map.get(“encryptedData”).toString();
String _signature = SHA1.SHA1Digest(rawData + renStr);
String iv = map.get(“iv”).toString();
if (!_signature.equals(map.get(“signature”).toString())) {
responseMessage = “{\“code\”:1,\“message\”:\“数据效验失败\”}”;
}