Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
469c8ee0
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
469c8ee0
编写于
5月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!18356 add error code in huks doc md
Merge pull request !18356 from zengbenchong/master
上级
c5f4ffce
794dcb07
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
479 addition
and
0 deletion
+479
-0
zh-cn/application-dev/reference/apis/js-apis-huks.md
zh-cn/application-dev/reference/apis/js-apis-huks.md
+479
-0
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-huks.md
浏览文件 @
469c8ee0
...
@@ -77,6 +77,25 @@ generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\
...
@@ -77,6 +77,25 @@ generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于存放生成key所需TAG。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于存放生成key所需TAG。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。未捕获error时代表用户指定别名的密钥生成成功,基于密钥不出TEE原则,此接口不会返回密钥材料内容,若捕获error,则为生成阶段出现异常。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。未捕获error时代表用户指定别名的密钥生成成功,基于密钥不出TEE原则,此接口不会返回密钥材料内容,若捕获error,则为生成阶段出现异常。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -132,6 +151,25 @@ generateKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
...
@@ -132,6 +151,25 @@ generateKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
| keyAlias | string | 是 | 密钥别名。 |
| keyAlias | string | 是 | 密钥别名。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于存放生成key所需TAG。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于存放生成key所需TAG。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -188,6 +226,20 @@ deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<v
...
@@ -188,6 +226,20 @@ deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<v
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -224,6 +276,20 @@ deleteKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
...
@@ -224,6 +276,20 @@ deleteKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
| keyAlias | string | 是 | 密钥别名,应为生成key时传入的别名。 |
| keyAlias | string | 是 | 密钥别名,应为生成key时传入的别名。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -291,6 +357,26 @@ importKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<v
...
@@ -291,6 +357,26 @@ importKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<v
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的密钥。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的密钥。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -358,6 +444,26 @@ importKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
...
@@ -358,6 +444,26 @@ importKeyItem(keyAlias: string, options: HuksOptions) : Promise\<void>
| keyAlias | string | 是 | 密钥别名。 |
| keyAlias | string | 是 | 密钥别名。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的密钥。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的密钥。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -428,6 +534,25 @@ attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<H
...
@@ -428,6 +534,25 @@ attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<H
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于获取证书时指定所需参数与数据。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于获取证书时指定所需参数与数据。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 201 | check permission failed. |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -555,6 +680,25 @@ attestKeyItem(keyAlias: string, options: HuksOptions) : Promise\<HuksReturnResul
...
@@ -555,6 +680,25 @@ attestKeyItem(keyAlias: string, options: HuksOptions) : Promise\<HuksReturnResul
| ---------------------------------------------- | --------------------------------------------- |
| ---------------------------------------------- | --------------------------------------------- |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。不返回err值时表示接口使用成功,其他时为错误。 |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。不返回err值时表示接口使用成功,其他时为错误。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 201 | check permission failed. |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -678,6 +822,26 @@ importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOp
...
@@ -678,6 +822,26 @@ importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOp
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -893,6 +1057,26 @@ importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOp
...
@@ -893,6 +1057,26 @@ importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOp
| wrappingKeyAlias | string | 是 | 密钥别名,对应密钥用于解密加密的密钥数据。 |
| wrappingKeyAlias | string | 是 | 密钥别名,对应密钥用于解密加密的密钥数据。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。其中密钥使用的算法、密钥用途、密钥长度为必选参数。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000013 | queried credential does not exist. |
| 12000014 | memory is insufficient. |
| 12000015 | call service failed. |
**示例:**
**示例:**
```
js
```
js
...
@@ -928,6 +1112,24 @@ exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<H
...
@@ -928,6 +1112,24 @@ exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<H
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。outData:返回从密钥中导出的公钥。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。outData:返回从密钥中导出的公钥。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -970,6 +1172,24 @@ exportKeyItem(keyAlias: string, options: HuksOptions) : Promise\<HuksReturnResul
...
@@ -970,6 +1172,24 @@ exportKeyItem(keyAlias: string, options: HuksOptions) : Promise\<HuksReturnResul
| ---------------------------------------------- | ------------------------------------------------------------ |
| ---------------------------------------------- | ------------------------------------------------------------ |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。不返回err值时表示接口使用成功,其他时为错误。outData:返回从密钥中导出的公钥。 |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。不返回err值时表示接口使用成功,其他时为错误。outData:返回从密钥中导出的公钥。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1007,6 +1227,24 @@ getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCall
...
@@ -1007,6 +1227,24 @@ getKeyItemProperties(keyAlias: string, options: HuksOptions, callback: AsyncCall
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。properties:返回值为生成密钥时所需参数。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。不返回err值时表示接口使用成功,其他时为错误。properties:返回值为生成密钥时所需参数。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1049,6 +1287,24 @@ getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise\<HuksRetu
...
@@ -1049,6 +1287,24 @@ getKeyItemProperties(keyAlias: string, options: HuksOptions) : Promise\<HuksRetu
| ----------------------------------------------- | ------------------------------------------------------------ |
| ----------------------------------------------- | ------------------------------------------------------------ |
| Promise
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | Promise对象。不返回err值时表示接口使用成功,其他时为错误。properties:返回值为生成密钥时所需参数。 |
| Promise
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | Promise对象。不返回err值时表示接口使用成功,其他时为错误。properties:返回值为生成密钥时所需参数。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1086,6 +1342,22 @@ isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<
...
@@ -1086,6 +1342,22 @@ isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback\<
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | 空对象(此处传空即可)。 |
| callback | AsyncCallback
\<
boolean> | 是 | 回调函数。若密钥存在,data为true,若密钥不存在,则error中会输出密钥不存在的error code。 |
| callback | AsyncCallback
\<
boolean> | 是 | 回调函数。若密钥存在,data为true,若密钥不存在,则error中会输出密钥不存在的error code。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1132,6 +1404,22 @@ isKeyItemExist(keyAlias: string, options: HuksOptions) : Promise\<boolean>
...
@@ -1132,6 +1404,22 @@ isKeyItemExist(keyAlias: string, options: HuksOptions) : Promise\<boolean>
| ----------------- | --------------------------------------- |
| ----------------- | --------------------------------------- |
| Promise
\<
boolean> | Promise对象。密钥存在时,可通过then进行密钥存在后的相关处理,若不存在,可通过error处理密钥不存在后的相关业务操作。 |
| Promise
\<
boolean> | Promise对象。密钥存在时,可通过then进行密钥存在后的相关处理,若不存在,可通过error处理密钥不存在后的相关业务操作。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1171,6 +1459,25 @@ initSession操作密钥接口,使用Callback回调异步返回结果。huks.in
...
@@ -1171,6 +1459,25 @@ initSession操作密钥接口,使用Callback回调异步返回结果。huks.in
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | initSession操作的参数集合。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | initSession操作的参数集合。 |
| callback | AsyncCallback
\<
[
HuksSessionHandle
](
#hukssessionhandle9
)
> | 是 | 回调函数。将initSession操作返回的handle添加到密钥管理系统的回调。 |
| callback | AsyncCallback
\<
[
HuksSessionHandle
](
#hukssessionhandle9
)
> | 是 | 回调函数。将initSession操作返回的handle添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000010 | the number of sessions has reached limit. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.initSession<sup>9+</sup>
## huks.initSession<sup>9+</sup>
initSession(keyAlias: string, options: HuksOptions) : Promise
\<
HuksSessionHandle>
initSession(keyAlias: string, options: HuksOptions) : Promise
\<
HuksSessionHandle>
...
@@ -1192,6 +1499,25 @@ initSession操作密钥接口,使用Promise方式异步返回结果。huks.ini
...
@@ -1192,6 +1499,25 @@ initSession操作密钥接口,使用Promise方式异步返回结果。huks.ini
| ----------------------------------- | -------------------------------------------------- |
| ----------------------------------- | -------------------------------------------------- |
| Promise
\<
[
HuksSessionHandle
](
#hukssessionhandle9
)
> | Promise对象。将initSession操作返回的handle添加到密钥管理系统的回调。 |
| Promise
\<
[
HuksSessionHandle
](
#hukssessionhandle9
)
> | Promise对象。将initSession操作返回的handle添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000010 | the number of sessions has reached limit. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.updateSession<sup>9+</sup>
## huks.updateSession<sup>9+</sup>
updateSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
HuksReturnResult>) : void
updateSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
HuksReturnResult>) : void
...
@@ -1208,6 +1534,26 @@ updateSession操作密钥接口,使用Callback回调异步返回结果。huks.
...
@@ -1208,6 +1534,26 @@ updateSession操作密钥接口,使用Callback回调异步返回结果。huks.
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | updateSession的参数集合。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | updateSession的参数集合。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将updateSession操作的结果添加到密钥管理系统的回调。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将updateSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.updateSession<sup>9+</sup>
## huks.updateSession<sup>9+</sup>
...
@@ -1226,6 +1572,27 @@ updateSession操作密钥接口,使用Callback回调异步返回结果。huks.
...
@@ -1226,6 +1572,27 @@ updateSession操作密钥接口,使用Callback回调异步返回结果。huks.
| token | Uint8Array | 是 | updateSession操作的token。 |
| token | Uint8Array | 是 | updateSession操作的token。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将updateSession操作的结果添加到密钥管理系统的回调。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将updateSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.updateSession<sup>9+</sup>
## huks.updateSession<sup>9+</sup>
updateSession(handle: number, options: HuksOptions, token?: Uint8Array) : Promise
\<
HuksReturnResult>
updateSession(handle: number, options: HuksOptions, token?: Uint8Array) : Promise
\<
HuksReturnResult>
...
@@ -1248,6 +1615,27 @@ updateSession操作密钥接口,使用Promise方式异步返回结果。huks.i
...
@@ -1248,6 +1615,27 @@ updateSession操作密钥接口,使用Promise方式异步返回结果。huks.i
| ----------------------------------- | -------------------------------------------------- |
| ----------------------------------- | -------------------------------------------------- |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。将updateSession操作的结果添加到密钥管理系统的回调。 |
| Promise
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| Promise对象。将updateSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.finishSession<sup>9+</sup>
## huks.finishSession<sup>9+</sup>
finishSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
HuksReturnResult>) : void
finishSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
HuksReturnResult>) : void
...
@@ -1265,6 +1653,27 @@ finishSession操作密钥接口,使用Callback回调异步返回结果。huks.
...
@@ -1265,6 +1653,27 @@ finishSession操作密钥接口,使用Callback回调异步返回结果。huks.
| token | Uint8Array | 是 | finishSession操作的token。 |
| token | Uint8Array | 是 | finishSession操作的token。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将finishSession操作的结果添加到密钥管理系统的回调。 |
| callback | AsyncCallback
<
[
HuksReturnResult
](
#huksreturnresult9
)
>
| 是 | 回调函数。将finishSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.finishSession<sup>9+</sup>
## huks.finishSession<sup>9+</sup>
finishSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback
\<
HuksReturnResult>) : void
finishSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback
\<
HuksReturnResult>) : void
...
@@ -1282,6 +1691,27 @@ finishSession操作密钥接口,使用Callback回调异步返回结果。huks.
...
@@ -1282,6 +1691,27 @@ finishSession操作密钥接口,使用Callback回调异步返回结果。huks.
| token | Uint8Array | 是 | finishSession操作的token。 |
| token | Uint8Array | 是 | finishSession操作的token。 |
| callback | AsyncCallback
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | 是 | 回调函数。将finishSession操作的结果添加到密钥管理系统的回调。 |
| callback | AsyncCallback
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | 是 | 回调函数。将finishSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.finishSession<sup>9+</sup>
## huks.finishSession<sup>9+</sup>
finishSession(handle: number, options: HuksOptions, token?: Uint8Array) : Promise
\<
HuksReturnResult>
finishSession(handle: number, options: HuksOptions, token?: Uint8Array) : Promise
\<
HuksReturnResult>
...
@@ -1304,6 +1734,27 @@ finishSession操作密钥接口,使用Promise方式异步返回结果。huks.i
...
@@ -1304,6 +1734,27 @@ finishSession操作密钥接口,使用Promise方式异步返回结果。huks.i
| ----------------------------------- | -------------------------------------------------- |
| ----------------------------------- | -------------------------------------------------- |
| Promise
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | Promise对象,用于获取异步返回结果。 |
| Promise
\<
[
HuksReturnResult
](
#huksreturnresult9
)
> | Promise对象,用于获取异步返回结果。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000001 | algorithm mode is not supported. |
| 12000002 | algorithm param is missing. |
| 12000003 | algorithm param is invalid. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000007 | this credential is already invalidated permanently. |
| 12000008 | verify authtoken failed. |
| 12000009 | authtoken is already timeout. |
| 12000011 | queried entity does not exist. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
## huks.abortSession<sup>9+</sup>
## huks.abortSession<sup>9+</sup>
abortSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
void>) : void
abortSession(handle: number, options: HuksOptions, callback: AsyncCallback
\<
void>) : void
...
@@ -1320,6 +1771,20 @@ abortSession操作密钥接口,使用Callback回调异步返回结果 。
...
@@ -1320,6 +1771,20 @@ abortSession操作密钥接口,使用Callback回调异步返回结果 。
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | abortSession操作的参数集合。 |
| options |
[
HuksOptions
](
#huksoptions
)
| 是 | abortSession操作的参数集合。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。将abortSession操作的结果添加到密钥管理系统的回调。 |
| callback | AsyncCallback
\<
void> | 是 | 回调函数。将abortSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
@@ -1470,6 +1935,20 @@ abortSession操作密钥接口,使用Promise方式异步返回结果。
...
@@ -1470,6 +1935,20 @@ abortSession操作密钥接口,使用Promise方式异步返回结果。
| ----------------------------------- | -------------------------------------------------- |
| ----------------------------------- | -------------------------------------------------- |
| Promise
\<
void> | Promise对象。将abortSession操作的结果添加到密钥管理系统的回调。 |
| Promise
\<
void> | Promise对象。将abortSession操作的结果添加到密钥管理系统的回调。 |
**错误码:**
以下错误码的详细介绍请参见
[
HUKS错误码
](
../errorcodes/errorcode-huks.md
)
。
| 错误码ID | 错误信息 |
| -------- | ------------- |
| 401 | argument is invalid. |
| 801 | api is not supported. |
| 12000004 | operating file failed. |
| 12000005 | IPC communication failed. |
| 12000006 | error occured in crypto engine. |
| 12000012 | external error. |
| 12000014 | memory is insufficient. |
**示例:**
**示例:**
```
js
```
js
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录