Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
smartDevices-platform-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4fa64bb9
authored
Mar 22, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码整改
1 parent
5263c796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
23 deletions
src/main/java/cn/com/glsx/modules/utils/TuyaUtils.java
src/main/java/cn/com/glsx/modules/utils/TuyaUtils.java
View file @
4fa64bb
...
@@ -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 时间戳
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment