未验证 提交 4aa2f48d 编写于 作者: O openharmony_ci 提交者: Gitee

!8871 修改HUKS demo代码

Merge pull request !8871 from CheungVane/master
......@@ -822,9 +822,9 @@ async function attestKey() {
properties: properties
};
generateKey(aliasString);
setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) {
huks.attestKey(aliasString, options, function (err, data) {
printLog(`key attest result : ${JSON.stringify(data)}`);
}), 1000);
});
}
```
......@@ -894,8 +894,13 @@ async function attestKey() {
properties: properties
};
generateKey(aliasString);
let result = await huks.exportKey(attestKey, options);
printLog(`key attest result : ${result.errorCode}`);
huks.attestKey(aliasString, options)
.then((data) => {
console.log(`test attestKey data: ${JSON.stringify(data)}`);
})
.catch((err) => {
console.log('test attestKey information: ' + JSON.stringify(err));
});
}
```
......
......@@ -822,9 +822,9 @@ async function attestKey() {
properties: properties
};
generateKey(aliasString);
setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) {
huks.attestKey(aliasString, options, function (err, data) {
printLog(`key attest result : ${JSON.stringify(data)}`);
}), 1000);
});
}
```
......@@ -894,8 +894,13 @@ async function attestKey() {
properties: properties
};
generateKey(aliasString);
let result = await huks.exportKey(attestKey, options);
printLog(`key attest result : ${result.errorCode}`);
huks.attestKey(aliasString, options)
.then((data) => {
console.log(`test attestKey data: ${JSON.stringify(data)}`);
})
.catch((err) => {
console.log('test attestKey information: ' + JSON.stringify(err));
});
}
```
......@@ -1491,7 +1496,7 @@ finish操作密钥接口,使用Promise方式异步返回结果。
| handle | number | 是 | Finish操作的handle。 |
| options | [HuksOptions](#huksoptions) | 是 | Finish操作的参数集合。 |
| token | Uint8Array | 否 | Finish操作的token。 |
| promise | Promise\<[HuksResult](#Huksresult)> | 是 | promise实例,用于获取异步返回结果。 |
| promise | Promise\<[HuksResult](#huksresult)> | 是 | promise实例,用于获取异步返回结果。 |
## huks.abort
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册