Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2b82fd2f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2b82fd2f
编写于
9月 02, 2022
作者:
Z
zhanghanlin9
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aaaa
Signed-off-by:
N
zhanghanlin9
<
zhanghanlin9@huawei.com
>
上级
1a9f665d
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
171 addition
and
563 deletion
+171
-563
security/security_huks_basic/huks_hmac_promise_BasicTest/src/main/js/test/HMAC/SecurityHuksFaceFingerNormalJsunit.test.js
...n/js/test/HMAC/SecurityHuksFaceFingerNormalJsunit.test.js
+85
-562
security/security_huks_basic/huks_hmac_promise_BasicTest/src/main/js/test/HMAC/SecurityHuksHmacBasicPromiseJsunit.test.js
...n/js/test/HMAC/SecurityHuksHmacBasicPromiseJsunit.test.js
+86
-1
未找到文件。
security/security_huks_basic/huks_hmac_promise_BasicTest/src/main/js/test/HMAC/SecurityHuksFaceFingerNormalJsunit.test.js
浏览文件 @
2b82fd2f
此差异已折叠。
点击以展开。
security/security_huks_basic/huks_hmac_promise_BasicTest/src/main/js/test/HMAC/SecurityHuksHmacBasicPromiseJsunit.test.js
浏览文件 @
2b82fd2f
...
...
@@ -22,6 +22,7 @@ import { stringToArray } from "../../../../../../utils/param/publicFunc.js";
var
handle
;
let
srcData63Kb
=
Data
.
Date63KB
;
let
srcData65Kb
=
Data
.
Date65KB
;
let
emptyOptions
=
{
properties
:
[]
};
async
function
publicHmacGenFunc
(
srcKeyAlies
,
HuksOptions
)
{
HuksOptions
.
properties
.
splice
(
1
,
0
,
HuksHmac
.
HuksKeySIZE
);
...
...
@@ -32,12 +33,96 @@ async function publicHmacGenFunc(srcKeyAlies, HuksOptions) {
expect
(
data
.
errorCode
==
0
).
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
log
(
"
test generateKey err information:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
test generateKey err information:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
});
await
huks
.
getKeyProperties
(
srcKeyAlies
,
HuksOptions
)
.
then
(
async
(
data
)
=>
{
console
.
log
(
`test finish data
${
JSON
.
stringify
(
data
)}
`
);
expect
(
data
.
errorCode
==
0
).
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
error
(
"
test init err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
});
await
getKeyProperties
(
srcKeyAlies
,
HuksOptions
)
.
then
((
data
)
=>
{
console
.
log
(
"
test generateKey data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
errorCode
==
0
).
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
error
(
"
test init err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
});
await
huks
.
isKeyExist
(
srcKeyAlies
,
emptyOptions
)
.
then
(
async
(
data
)
=>
{
console
.
log
(
"
isKeyExist111 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
==
true
).
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
error
(
"
isKeyExist111 err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
});
await
isKeyExist
(
srcKeyAlies
,
emptyOptions
)
.
then
((
data
)
=>
{
console
.
log
(
"
isKeyExist111 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
==
true
).
assertTrue
();
})
.
catch
((
err
)
=>
{
console
.
error
(
"
isKeyExist111 err:
"
+
JSON
.
stringify
(
err
));
expect
(
null
).
assertFail
();
});
HuksOptions
.
properties
.
splice
(
1
,
1
);
}
function
getKeyProperties
(
srcKeyAlies
,
HuksOptions
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
huks
.
getKeyProperties
(
srcKeyAlies
,
HuksOptions
,
function
(
err
,
data
)
{
try
{
if
(
err
.
code
!=
0
)
{
console
.
error
(
"
test generateKey err information:
"
+
JSON
.
stringify
(
err
)
);
reject
(
err
);
}
else
{
resolve
(
data
);
}
}
catch
(
e
)
{
console
.
error
(
"
test generateKey err information::
"
+
JSON
.
stringify
(
e
)
);
reject
(
e
);
}
});
});
}
function
isKeyExist
(
srcKeyAlies
,
emptyOptions
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
huks
.
isKeyExist
(
srcKeyAlies
,
emptyOptions
,
function
(
err
,
data
)
{
try
{
if
(
err
.
code
!=
0
)
{
console
.
error
(
"
test isKeyExist err information:
"
+
JSON
.
stringify
(
err
)
);
reject
(
err
);
}
else
{
resolve
(
data
);
}
}
catch
(
e
)
{
console
.
error
(
"
test isKeyExist err information:
"
+
JSON
.
stringify
(
e
));
reject
(
e
);
}
});
});
}
async
function
publicHmacInitFunc
(
srcKeyAlies
,
HuksOptions
)
{
await
huks
.
init
(
srcKeyAlies
,
HuksOptions
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录