Commit 4fa64bb9 by 111-PC\111

[+]代码整改

1 parent 5263c796
...@@ -13,29 +13,6 @@ import javax.xml.bind.annotation.adapters.HexBinaryAdapter; ...@@ -13,29 +13,6 @@ import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
public class TuyaUtils { public class TuyaUtils {
/** /**
* 获取令牌签名
*
* @param time 时间戳
* @param client_id client_id
* @param secret secret
* @return
*/
public static String getLoginSign(long time, String client_id, String secret) {
String hash=null;
try {
String message = client_id + time;
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes(), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] bytes = sha256_HMAC.doFinal(message.getBytes());
hash = new HexBinaryAdapter().marshal(bytes).toUpperCase();
} catch (Exception e) {
e.printStackTrace();
}
return hash;
}
/**
* 获取业务的签名 * 获取业务的签名
* *
* @param time 时间戳 * @param time 时间戳
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!