diff --git a/en/application-dev/reference/apis/js-apis-huks.md b/en/application-dev/reference/apis/js-apis-huks.md index a4973fc1edefbd0d54cfff5e6900b48edd9ef68a..6cd14aeb285b3ec93581dbc7f425d06eda1907c5 100644 --- a/en/application-dev/reference/apis/js-apis-huks.md +++ b/en/application-dev/reference/apis/js-apis-huks.md @@ -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)); + }); } ```