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

!21881 [翻译完成】#I7H2LF

Merge pull request !21881 from Annie_wang/PR20214
......@@ -3,11 +3,11 @@
## Overview
Defines the capabilities of OpenHarmony Universal KeyStore (HUKS) parameter sets. The HUKS APIs can be used to perform parameter set lifecycle management, including initializing a parameter set, adding parameters to a parameter set, constructing a parameter set, and destroying a parameter set. They can also be used to obtain parameters, copy parameter sets, and check parameter validity.
Defines HUKS parameter set management capabilities, including HUKS parameter set lifecycle management such as initializing a parameter set, adding parameters, building a parameter set, and freeing a parameter set, as well as functions such as obtaining parameters, copying a parameter set, querying a parameter set, and checking the validity of a parameter set.
\@syscap SystemCapability.Security.Huks
**Since:**
**Since**:
9
......@@ -16,25 +16,25 @@ Defines the capabilities of OpenHarmony Universal KeyStore (HUKS) parameter sets
### Files
| Name | Description |
| Name| Description|
| -------- | -------- |
| [native_huks_param.h](native__huks__param_8h.md) | Provides APIs for constructing, using, and destroying parameter sets. <br>File to Include: <huks/native_huks/native_huks_param.h> |
| [native_huks_param.h](native__huks__param_8h.md) | Provides APIs for constructing, using, and destroying parameter sets.<br>**File to include**: <huks/native_huks/native_huks_param.h><br>**Library**: libhuks_ndk.z.so|
### Functions
| Name | Description |
| Name| Description|
| -------- | -------- |
| [OH_Huks_InitParamSet](#oh_huks_initparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Initializes a parameter set. |
| [OH_Huks_AddParams](#oh_huks_addparams) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Param](_o_h___huks___param.md) \*params, uint32_t paramCnt) | Adds parameters to a parameter set. |
| [OH_Huks_BuildParamSet](#oh_huks_buildparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Constructs a parameter set. |
| [OH_Huks_FreeParamSet](#oh_huks_freeparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Destroys a parameter set. |
| [OH_Huks_CopyParamSet](#oh_huks_copyparamset) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*fromParamSet, uint32_t fromParamSetSize, struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Copies a parameter set (deep copy). |
| [OH_Huks_GetParam](#oh_huks_getparam) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, uint32_t tag, struct [OH_Huks_Param](_o_h___huks___param.md) \*\*param) | Obtains parameters from a parameter set. |
| [OH_Huks_FreshParamSet](#oh_huks_freshparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, bool isCopy) | Refreshes data of the **Blob** type in a parameter set. |
| [OH_Huks_isParamSetTagValid](#oh_huks_isparamsettagvalid) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet) | Checks whether the parameters in a parameter set are valid. |
| [OH_Huks_isParamSetValid](#oh_huks_isparamsetvalid) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, uint32_t size) | Checks whether a parameter set is of the valid size. |
| [OH_Huks_CheckParamMatch](#oh_huks_checkparammatch) (const struct [OH_Huks_Param](_o_h___huks___param.md) \*baseParam, const struct [OH_Huks_Param](_o_h___huks___param.md) \*param) | Checks whether two parameters are the same. |
| [OH_Huks_InitParamSet](#oh_huks_initparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Initializes a parameter set. |
| [OH_Huks_AddParams](#oh_huks_addparams) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Param](_o_h___huks___param.md) \*params, uint32_t paramCnt) | Adds parameters to a parameter set. |
| [OH_Huks_BuildParamSet](#oh_huks_buildparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Builds a parameter set. |
| [OH_Huks_FreeParamSet](#oh_huks_freeparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Frees a parameter set. |
| [OH_Huks_CopyParamSet](#oh_huks_copyparamset) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*fromParamSet, uint32_t fromParamSetSize, struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*\*paramSet) | Copies a parameter set (deep copy). |
| [OH_Huks_GetParam](#oh_huks_getparam) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, uint32_t tag, struct [OH_Huks_Param](_o_h___huks___param.md) \*\*param) | Obtains a parameter from a parameter set. |
| [OH_Huks_FreshParamSet](#oh_huks_freshparamset) (struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, bool isCopy) | Refreshes data of the Blob type in a parameter set. |
| [OH_Huks_isParamSetTagValid](#oh_huks_isparamsettagvalid) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet) | Checks whether the parameters in a parameter set are valid. |
| [OH_Huks_isParamSetValid](#oh_huks_isparamsetvalid) (const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, uint32_t size) | Checks whether a parameter set is of the valid size. |
| [OH_Huks_CheckParamMatch](#oh_huks_checkparammatch) (const struct [OH_Huks_Param](_o_h___huks___param.md) \*baseParam, const struct [OH_Huks_Param](_o_h___huks___param.md) \*param) | Checks whether two parameters are the same. |
## Function Description
......@@ -42,20 +42,21 @@ Defines the capabilities of OpenHarmony Universal KeyStore (HUKS) parameter sets
### OH_Huks_AddParams()
```
int32_t OH_Huks_AddParams (struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Param * params, uint32_t paramCnt )
```
**Description**<br>
**Description**
Adds parameters to a parameter set.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the pointer to the parameter set to which parameters are to be added. |
| params | Indicates the pointer to the array of parameters to add. |
| paramCnt | Indicates the number of parameters to add. |
| paramSet | Indicates the pointer to the parameter set to which parameters are to be added. |
| params | Indicates the pointer to an array of parameters to add. |
| paramCnt | Indicates the number of parameters to add. |
**Returns**
......@@ -64,18 +65,19 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
### OH_Huks_BuildParamSet()
```
int32_t OH_Huks_BuildParamSet (struct OH_Huks_ParamSet ** paramSet)
```
**Description**<br>
Constructs a parameter set.
**Description**
**Parameters**
Builds a parameter set.
| Name | Description |
**Parameters**
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the double pointer to the parameter set to construct. |
| paramSet | Indicates the double pointer to the parameter set to build. |
**Returns**
......@@ -84,19 +86,20 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
### OH_Huks_CheckParamMatch()
```
int32_t OH_Huks_CheckParamMatch (const struct OH_Huks_Param * baseParam, const struct OH_Huks_Param * param )
```
**Description**<br>
**Description**
Checks whether two parameters are the same.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| baseParam | Indicates the pointer to the first parameter. |
| param | Indicates the pointer to the second parameter. |
| baseParam | Indicates the pointer to the first parameter to compare. |
| param | Indicates the pointer to the second parameter to compare. |
**Returns**
......@@ -105,20 +108,21 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the two paramete
### OH_Huks_CopyParamSet()
```
int32_t OH_Huks_CopyParamSet (const struct OH_Huks_ParamSet * fromParamSet, uint32_t fromParamSetSize, struct OH_Huks_ParamSet ** paramSet )
```
**Description**<br>
**Description**
Copies a parameter set (deep copy).
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| fromParamSet | Indicates the pointer to the parameter set to copy. |
| fromParamSetSize | Indicates the memory size occupied by the source parameter set. |
| paramSet | Indicates the double pointer to the new parameter set generated. |
| fromParamSet | Indicates the pointer to the parameter set to copy. |
| fromParamSetSize | Indicates the size of the memory occupied by the copied parameter set. |
| paramSet | Indicates the double pointer to the new parameter set generated. |
**Returns**
......@@ -127,119 +131,125 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
### OH_Huks_FreeParamSet()
```
void OH_Huks_FreeParamSet (struct OH_Huks_ParamSet ** paramSet)
```
**Description**<br>
Destroys a parameter set.
**Description**
**Parameters**
Frees a parameter set.
| Name | Description |
**Parameters**
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the double pointer to the parameter set to destroy. |
| paramSet | Indicates the pointer to the parameter set to free. |
### OH_Huks_FreshParamSet()
```
int32_t OH_Huks_FreshParamSet (struct OH_Huks_ParamSet * paramSet, bool isCopy )
```
**Description**<br>
Refreshes data of the **Blob** type in a parameter set.
**Description**
Refreshes data of the Blob type in a parameter set.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the pointer to the target parameter set. |
| isCopy | Specifies whether to copy the data of the **Blob** type to the parameter set. If yes, the data of the **Blob** type will be copied to the parameter set. Otherwise, only the address of the **Blob** data will be refreshed. |
| paramSet | Indicates the pointer to the target parameter set. |
| isCopy | Specifies whether to copy the data of the HksBlob type to the parameter set. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if operation is successful; returns an error code otherwise.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
### OH_Huks_GetParam()
```
int32_t OH_Huks_GetParam (const struct OH_Huks_ParamSet * paramSet, uint32_t tag, struct OH_Huks_Param ** param )
```
**Description**<br>
Obtains parameters from a parameter set.
**Description**
Obtains a parameter from a parameter set.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the pointer to the target parameter set. |
| tag | Indicates the value of the parameter to be obtained. |
| param | Indicates the double pointer to the parameter obtained. |
| paramSet | Indicates the pointer to the target parameter set. |
| tag | Indicates the name of the parameter to obtain. |
| param | Indicates the double pointer to the obtained parameter. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful, returns an error code otherwise.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
### OH_Huks_InitParamSet()
```
int32_t OH_Huks_InitParamSet (struct OH_Huks_ParamSet ** paramSet)
```
**Description**<br>
**Description**
Initializes a parameter set.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the double pointer to the parameter set to initialize. |
| paramSet | Indicates the pointer to the parameter set to initialize. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the initialization is successful; returns an error code otherwise.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
### OH_Huks_isParamSetTagValid()
```
int32_t OH_Huks_isParamSetTagValid (const struct OH_Huks_ParamSet * paramSet)
```
**Description**<br>
**Description**
Checks whether the parameters in a parameter set are valid.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the pointer to the parameter set to check. |
| paramSet | Indicates the pointer to the parameter set to check. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the parameters in the parameter set are valid; returns other values if the parameter set has invalid, duplicate, or incorrect parameters.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the parameters in the parameter set are valid; returns an error code otherwise.
### OH_Huks_isParamSetValid()
```
int32_t OH_Huks_isParamSetValid (const struct OH_Huks_ParamSet * paramSet, uint32_t size )
```
**Description**<br>
**Description**
Checks whether a parameter set is of the valid size.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| paramSet | Indicates the pointer to the parameter set to check. |
| size | Indicates the memory size occupied by the parameter set. |
| paramSet | Indicates the pointer to the parameter set to check. |
| size | Indicates the memory size occupied by the parameter set. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the parameter set is of the valid size; returns an error code otherwise.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the size of the parameter set is valid; returns an error code otherwise.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册