提交 65dff8f5 编写于 作者: C CheungVane

modify the demo code

Signed-off-by: Nzhangwenzhi <zhangwenzhi3@huawei.com>
上级 a3e39182
...@@ -822,9 +822,9 @@ async function attestKey() { ...@@ -822,9 +822,9 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) { huks.attestKey(aliasString, options, function (err, data) {
printLog(`key attest result : ${JSON.stringify(data)}`); printLog(`key attest result : ${JSON.stringify(data)}`);
}), 1000); });
} }
``` ```
...@@ -894,8 +894,13 @@ async function attestKey() { ...@@ -894,8 +894,13 @@ async function attestKey() {
properties: properties properties: properties
}; };
generateKey(aliasString); generateKey(aliasString);
let result = await huks.exportKey(attestKey, options); huks.attestKey(aliasString, options)
printLog(`key attest result : ${result.errorCode}`); .then((data) => {
console.log(`test attestKey data: ${JSON.stringify(data)}`);
})
.catch((err) => {
console.log('test attestKey information: ' + JSON.stringify(err));
});
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册