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

!21886 挑单 4.0 Beta2

Merge pull request !21886 from Annie_wang/cherry-pick-1691052596
......@@ -7,36 +7,35 @@ Describes the OpenHarmony Universal KeyStore (HUKS) capabilities, including key
\@syscap SystemCapability.Security.Huks
**Since:**
**Since**:
9
## Summary
### Files
| Name | Description |
| Name| Description|
| -------- | -------- |
| [native_huks_api.h](native__huks__api_8h.md) | Declares the APIs used to access the HUKS. <br>File to Include: <huks/native_huks/api.h> |
| [native_huks_api.h](native__huks__api_8h.md) | Declares the APIs used to access the HUKS.<br>**File to include**: <huks/native_huks/api.h><br>**Library**: libhuks_ndk.z.so |
### Functions
| Name | Description |
| Name| Description|
| -------- | -------- |
| [OH_Huks_GetSdkVersion](#oh_huks_getsdkversion) (struct [OH_Huks_Blob](_o_h___huks___blob.md) \*sdkVersion) | Obtains the current HUKS SDK version. |
| [OH_Huks_GenerateKeyItem](#oh_huks_generatekeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetIn, struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetOut) | Generates a key. |
| [OH_Huks_ImportKeyItem](#oh_huks_importkeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*key) | Imports a key in plaintext. |
| [OH_Huks_ImportWrappedKeyItem](#oh_huks_importwrappedkeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*wrappingKeyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*wrappedKeyData) | Imports a wrapped key. |
| [OH_Huks_ImportWrappedKeyItem](#oh_huks_importwrappedkeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*wrappingKeyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*wrappedKeyData) | Imports a wrapped (encrypted) key. |
| [OH_Huks_ExportPublicKeyItem](#oh_huks_exportpublickeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*key) | Exports a public key. |
| [OH_Huks_DeleteKeyItem](#oh_huks_deletekeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet) | Deletes a key. |
| [OH_Huks_GetKeyItemParamSet](#oh_huks_getkeyitemparamset) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetIn, struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetOut) | Obtains the attributes of a key. |
| [OH_Huks_GetKeyItemParamSet](#oh_huks_getkeyitemparamset) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetIn, struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSetOut) | Obtains the properties of a key. |
| [OH_Huks_IsKeyItemExist](#oh_huks_iskeyitemexist) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet) | Checks whether a key exists. |
| [OH_Huks_AttestKeyItem](#oh_huks_attestkeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, struct [OH_Huks_CertChain](_o_h___huks___cert_chain.md) \*certChain) | Obtain the key certificate chain. |
| [OH_Huks_InitSession](#oh_huks_initsession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*challenge) | Initializes the key session interface and obtains a handle (mandatory) and challenge value (optional). |
| [OH_Huks_AttestKeyItem](#oh_huks_attestkeyitem) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, struct [OH_Huks_CertChain](_o_h___huks___cert_chain.md) \*certChain) | Obtains the certificate chain of a key. |
| [OH_Huks_InitSession](#oh_huks_initsession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*keyAlias, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*token) | Initializes a key session to obtain a handle (mandatory) and a token (optional). |
| [OH_Huks_UpdateSession](#oh_huks_updatesession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*inData, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*outData) | Adds data by segment for the key operation, performs the related key operation, and outputs the processed data. |
| [OH_Huks_FinishSession](#oh_huks_finishsession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*inData, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*outData) | Ends the key session. |
| [OH_Huks_FinishSession](#oh_huks_finishsession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet, const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*inData, struct [OH_Huks_Blob](_o_h___huks___blob.md) \*outData) | Finishes a key session. |
| [OH_Huks_AbortSession](#oh_huks_abortsession) (const struct [OH_Huks_Blob](_o_h___huks___blob.md) \*handle, const struct [OH_Huks_ParamSet](_o_h___huks___param_set.md) \*paramSet) | Aborts a key session. |
......@@ -49,12 +48,13 @@ Describes the OpenHarmony Universal KeyStore (HUKS) capabilities, including key
```
struct OH_Huks_Result OH_Huks_AbortSession (const struct OH_Huks_Blob * handle, const struct OH_Huks_ParamSet * paramSet )
```
**Description**<br>
**Description**
Aborts a key session.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| handle | Indicates the pointer to the key session handle, which is generated by [OH_Huks_InitSession](#oh_huks_initsession). |
| paramSet | Indicates the pointer to the parameters required for aborting the key session. By default, this parameter is a null pointer. |
......@@ -63,7 +63,7 @@ Aborts a key session.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
**See**
**See**
[OH_Huks_InitSession](#oh_huks_initsession)
......@@ -78,16 +78,17 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_AttestKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet, struct OH_Huks_CertChain * certChain )
```
**Description**<br>
Obtain the key certificate chain.
**Description**
Obtains the certificate chain of a key.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the target key. |
| paramSet | Indicates the pointer to the parameters required for obtaining the key certificate. |
| certChain | Indicates the pointer to the key certificate chain obtained. |
| paramSet | Indicates the pointer to the parameters required for obtaining the certificate chain. |
| certChain | Indicates the pointer to the certificate chain obtained. |
**Returns**
......@@ -100,14 +101,15 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_DeleteKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet )
```
**Description**<br>
**Description**
Deletes a key.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the key to delete. The alias must be the same as the alias for the key generated. |
| keyAlias | Indicates the pointer to the alias of the key to delete. It must be the same as the alias used for generating the key. |
| paramSet | Indicates the pointer to the parameters required for deleting the key. By default, this parameter is a null pointer. |
**Returns**
......@@ -121,14 +123,15 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_ExportPublicKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet, struct OH_Huks_Blob * key )
```
**Description**<br>
**Description**
Exports a public key.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the public key to export. The alias must be the same as the alias for the key generated. |
| keyAlias | Indicates the pointer to the alias of the public key to export. It must be the same as the alias used for generating the key. |
| paramSet | Indicates the pointer to the parameters required for exporting the public key. |
| key | Indicates the pointer to the public key exported. |
......@@ -143,23 +146,24 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_FinishSession (const struct OH_Huks_Blob * handle, const struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Blob * inData, struct OH_Huks_Blob * outData )
```
**Description**<br>
Ends the key session.
**Description**
**Parameters**
Finishes a key session.
| Name | Description |
**Parameters**
| Name| Description|
| -------- | -------- |
| handle | Indicates the pointer to the key session handle, which is generated by [OH_Huks_InitSession](#oh_huks_initsession). |
| paramSet | Indicates the pointer to the parameters required for the key operation. |
| inData | Indicates the pointer to the data to be processed. |
| inData | Indicates the pointer to the data to be passed in. |
| outData | Indicates the pointer to the output data. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
**See**
**See**
[OH_Huks_InitSession](#oh_huks_initsession)
......@@ -174,15 +178,16 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_GenerateKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSetIn, struct OH_Huks_ParamSet * paramSetOut )
```
**Description**<br>
**Description**
Generates a key.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the key to generate. The alias must be unique in the process of the service. Otherwise, the key will be overwritten. |
| paramSetIn | Indicates the pointer to the parameter set for generating the key. |
| keyAlias | Indicates the pointer to the alias of the key to generate. The alias must be unique in the process of the service. |
| paramSetIn | Indicates the pointer to the parameters for generating the key. |
| paramSetOut | Indicates the pointer to a temporary key generated. If the generated key is not of a temporary type, this parameter is a null pointer. |
**Returns**
......@@ -196,16 +201,17 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_GetKeyItemParamSet (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSetIn, struct OH_Huks_ParamSet * paramSetOut )
```
**Description**<br>
Obtains the attributes of a key.
**Description**
**Parameters**
Obtains the properties of a key.
| Name | Description |
**Parameters**
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the target key. |
| paramSetIn | Indicates the pointer to the attribute tag required for obtaining the attributes. By default, this parameter is a null pointer. |
| paramSetOut | Indicates the pointer to the attributes obtained. |
| paramSetIn | Indicates the pointer to the tag required for obtaining the properties. By default, this parameter is a null pointer. |
| paramSetOut | Indicates the pointer to the key properties obtained. |
**Returns**
......@@ -218,14 +224,15 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_GetSdkVersion (struct OH_Huks_Blob * sdkVersion)
```
**Description**<br>
**Description**
Obtains the current HUKS SDK version.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| sdkVersion | Indicates the pointer to the SDK version (in string format) obtained. |
| sdkVersion | Indicates the pointer to the SDK version (string) obtained. |
**Returns**
......@@ -238,16 +245,17 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_ImportKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Blob * key )
```
**Description**<br>
**Description**
Imports a key in plaintext.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the key to import. The alias must be unique in the process of the service. Otherwise, the key will be overwritten. |
| paramSet | Indicates the pointer to the parameters of the key to import. |
| key | Indicates the pointer to the key to import. The key must be in the format required by the HUKS. For details, see [HuksTypeApi](_huks_type_api.md). |
| keyAlias | Indicates the pointer to the alias of the key to import. The alias must be unique in the process of the service. |
| paramSet | Indicates the pointer to the properties of the key to import. |
| key | Indicates the pointer to the key to import. The key data must be in format defined in [HuksTypeApi](_huks_type_api.md). |
**Returns**
......@@ -260,17 +268,18 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_ImportWrappedKeyItem (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_Blob * wrappingKeyAlias, const struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Blob * wrappedKeyData )
```
**Description**<br>
Imports a wrapped key.
**Description**
Imports a wrapped (encrypted) key.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the key to import. The alias must be unique in the process of the service. Otherwise, the key will be overwritten. |
| keyAlias | Indicates the pointer to the alias of the key to import. The alias must be unique in the process of the service. |
| wrappingKeyAlias | Indicates the pointer to the alias of the wrapping key, which is obtained through key agreement and used to decrypt the key to import. |
| paramSet | Indicates the pointer to the parameters of the wrapped key to import. |
| wrappedKeyData | Indicates the pointer to the wrapped key to import. The key must be in the format required by the HUKS. For details, see [OH_Huks_AlgSuite](_huks_type_api.md#oh_huks_algsuite). |
| paramSet | Indicates the pointer to the parameters for importing the wrapped key. |
| wrappedKeyData | Indicates the pointer to the wrapped key to import. The data must be in the format defined in [OH_Huks_AlgSuite](_huks_type_api.md#oh_huks_algsuite).|
**Returns**
......@@ -281,25 +290,26 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_InitSession (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet, struct OH_Huks_Blob * handle, struct OH_Huks_Blob * challenge )
struct OH_Huks_Result OH_Huks_InitSession (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet, struct OH_Huks_Blob * handle, struct OH_Huks_Blob * token )
```
**Description**<br>
Initializes the key session interface and obtains a handle (mandatory) and challenge value (optional).
**Description**
**Parameters**
Initializes a key session to obtain a handle (mandatory) and a token (optional).
| Name | Description |
**Parameters**
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the target key. |
| paramSet | Indicates the pointer to the parameters for the initialization operation. |
| handle | Indicates the pointer to the handle of the key session obtained. This handle is required for subsequent operations, including [OH_Huks_UpdateSession](#oh_huks_updatesession), [OH_Huks_FinishSession](#oh_huks_finishsession), and [OH_Huks_AbortSession](#oh_huks_abortsession). |
| challenge | Indicates the pointer to the challenge value obtained. |
| handle | Indicates the pointer to the handle of the key session. This handle is required for subsequent operations of the same key, including [OH_Huks_UpdateSession](#oh_huks_updatesession), [OH_Huks_FinishSession](#oh_huks_finishsession), and [OH_Huks_AbortSession](#oh_huks_abortsession). |
| token | Indicates the pointer to the token used for key access control. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
**See**
**See**
[OH_Huks_UpdateSession](#oh_huks_updatesession)
......@@ -314,23 +324,20 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
struct OH_Huks_Result OH_Huks_IsKeyItemExist (const struct OH_Huks_Blob * keyAlias, const struct OH_Huks_ParamSet * paramSet )
```
**Description**<br>
**Description**
Checks whether a key exists.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| keyAlias | Indicates the pointer to the alias of the target key. |
| paramSet | Indicates the pointer to the attribute tag required for checking the key. By default, this parameter is a null pointer. |
| keyAlias | Indicates the pointer to the alias of the key to check. |
| paramSet | Indicates the pointer to the parameters required for checking the key. By default, this parameter is a null pointer. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the key exists.
Returns [OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ITEM_NOT_EXIST](_huks_type_api.md) if the key does not exist.
Returns any other error code for other cases.
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the key exists.<br>Returns [OH_Huks_ErrCode#OH_HUKS_ERR_CODE_ITEM_NOT_EXIST](_huks_type_api.md) if the key does not exist.<br>Returns any other error code for other cases.
### OH_Huks_UpdateSession()
......@@ -339,23 +346,24 @@ Returns any other error code for other cases.
```
struct OH_Huks_Result OH_Huks_UpdateSession (const struct OH_Huks_Blob * handle, const struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Blob * inData, struct OH_Huks_Blob * outData )
```
**Description**<br>
**Description**
Adds data by segment for the key operation, performs the related key operation, and outputs the processed data.
**Parameters**
**Parameters**
| Name | Description |
| Name| Description|
| -------- | -------- |
| handle | Indicates the pointer to the key session handle, which is generated by [OH_Huks_InitSession](#oh_huks_initsession). |
| paramSet | Indicates the pointer to the parameters required for the key operation. |
| inData | Indicates the pointer to the data to be processed. This API can be called multiples time to process large data by segment. |
| inData | Indicates the pointer to the data to be processed. This API can be called multiple times to process large data by segment. |
| outData | Indicates the pointer to the output data. |
**Returns**
Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is successful; returns an error code otherwise.
**See**
**See**
[OH_Huks_InitSession](#oh_huks_initsession)
......
......@@ -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,22 +16,22 @@ 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_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 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_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. |
......@@ -46,15 +46,16 @@ Defines the capabilities of OpenHarmony Universal KeyStore (HUKS) parameter sets
```
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. |
| params | Indicates the pointer to an array of parameters to add. |
| paramCnt | Indicates the number of parameters to add. |
**Returns**
......@@ -68,14 +69,15 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
int32_t OH_Huks_BuildParamSet (struct OH_Huks_ParamSet ** paramSet)
```
**Description**<br>
Constructs a parameter set.
**Description**
Builds a parameter set.
**Parameters**
**Parameters**
| Name | Description |
| 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**
......@@ -88,15 +90,16 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
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**
......@@ -109,15 +112,16 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the two paramete
```
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. |
| 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**
......@@ -131,14 +135,15 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
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()
......@@ -147,19 +152,20 @@ Destroys a parameter set.
```
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. |
| 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()
......@@ -168,20 +174,21 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if operation is suc
```
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**
**Parameters**
Obtains a parameter from a parameter set.
| Name | Description |
**Parameters**
| 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. |
| 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()
......@@ -190,18 +197,19 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the operation is
```
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()
......@@ -210,18 +218,19 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the initializati
```
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. |
**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()
......@@ -230,16 +239,17 @@ Returns [OH_Huks_ErrCode#OH_HUKS_SUCCESS](_huks_type_api.md) if the parameters i
```
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. |
**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.
先完成此消息的编辑!
想要评论请 注册