|
@@ -83,7 +83,7 @@ public class Encrypt {
|
|
} catch (UnsupportedEncodingException e) {
|
|
} catch (UnsupportedEncodingException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- log.info("HMACSHA256 data : {} , sign : {}",str,encdeStr);
|
|
|
|
|
|
+ log.info("SHA256 data : {} , sign : {}",str,encdeStr);
|
|
return encdeStr;
|
|
return encdeStr;
|
|
}
|
|
}
|
|
//---------
|
|
//---------
|
|
@@ -173,7 +173,7 @@ public class Encrypt {
|
|
|
|
|
|
byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
|
|
byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
|
|
|
|
|
|
- String encodeSign = base64.encodeToString(array);
|
|
|
|
|
|
+ String encodeSign = base64.encodeBase64String(array);
|
|
log.info("HMACSHA256 data : {} , sign : {}",data,encodeSign);
|
|
log.info("HMACSHA256 data : {} , sign : {}",data,encodeSign);
|
|
return encodeSign;
|
|
return encodeSign;
|
|
|
|
|
|
@@ -187,10 +187,10 @@ public class Encrypt {
|
|
param.put("idChannel","100103");
|
|
param.put("idChannel","100103");
|
|
param.put("idDevice","10.31.49.16");
|
|
param.put("idDevice","10.31.49.16");
|
|
|
|
|
|
- String sign1 = Encrypt.createSHA256Sign(param, "IhOTiTyMLDNNLFuP");
|
|
|
|
- log.info(sign1);
|
|
|
|
|
|
+// String sign1 = Encrypt.createSHA256Sign(param, "IhOTiTyMLDNNLFuP");
|
|
|
|
+// log.info(sign1);
|
|
|
|
|
|
- param.put("x-ts",System.currentTimeMillis() + "");
|
|
|
|
|
|
+ param.put("x-ts","159591203325");
|
|
log.info(JSONObject.toJSONString(param));
|
|
log.info(JSONObject.toJSONString(param));
|
|
String sign = Encrypt.createHMACSHA256(param,"IhOTiTyMLDNNLFuP");
|
|
String sign = Encrypt.createHMACSHA256(param,"IhOTiTyMLDNNLFuP");
|
|
log.info(sign);
|
|
log.info(sign);
|