harmony 鸿蒙HuksParamSetApi

2025-06-12 浏览 (1)

HuksParamSetApi

Overview

Defines functions for parameter set lifecycle management, including initializing a parameter set, adding parameters, building a parameter set, and freeing a parameter set, as well as parameter set operations such as obtaining parameters, copying a parameter set, querying a parameter set, and checking the validity of a parameter set.

System capability: SystemCapability.Security.Huks

Since: 9

Summary

File

NameDescription
native_huks_param.hDefines the functions for constructing, using, and destroying a parameter set.

Functions

NameDescription
struct OH_Huks_Result OH_Huks_InitParamSet (struct OH_Huks_ParamSet **paramSet)Initializes a parameter set and pre-allocates memory to paramSet.
struct OH_Huks_Result OH_Huks_AddParams (struct OH_Huks_ParamSet *paramSet, const struct OH_Huks_Param *params, uint32_t paramCnt)Adds parameters to a parameter set. Before calling this API, call OH_Huks_InitParamSet to initialize paramSet.
struct OH_Huks_Result OH_Huks_BuildParamSet (struct OH_Huks_ParamSet **paramSet)Builds a parameter set. After adding parameters to paramSet, call OH_Huks_BuildParamSet to integrate the parameter set.
void OH_Huks_FreeParamSet (struct OH_Huks_ParamSet **paramSet)Frees a parameter set.
struct OH_Huks_Result OH_Huks_CopyParamSet (const struct OH_Huks_ParamSet *fromParamSet, uint32_t fromParamSetSize, struct OH_Huks_ParamSet **paramSet)Copies a parameter set (deep copy).
struct OH_Huks_Result OH_Huks_GetParam (const struct OH_Huks_ParamSet *paramSet, uint32_t tag, struct OH_Huks_Param **param)Obtains a parameter from a parameter set.
struct OH_Huks_Result OH_Huks_FreshParamSet (struct OH_Huks_ParamSet *paramSet, bool isCopy)Updates the data of the OH_Huks_Blob type in a parameter set.
struct OH_Huks_Result OH_Huks_IsParamSetTagValid (const struct OH_Huks_ParamSet *paramSet)Checks whether the parameters in a parameter set are valid.
struct OH_Huks_Result OH_Huks_IsParamSetValid (const struct OH_Huks_ParamSet *paramSet, uint32_t size)Checks whether a parameter set is of the valid size.
struct OH_Huks_Result OH_Huks_CheckParamMatch (const struct OH_Huks_Param *baseParam, const struct OH_Huks_Param *param)Checks whether two parameters are the same.
void OH_Huks_FreeKeyAliasSet (struct OH_Huks_KeyAliasSet *keyAliasSet)Frees a key alias set.

Function Description

OH_Huks_AddParams()

struct OH_Huks_Result OH_Huks_AddParams (struct OH_Huks_ParamSet * paramSet, const struct OH_Huks_Param * params, uint32_t paramCnt )

Description Adds parameters to a parameter set.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to which parameters are to be added.
paramsPointer to an array of parameters to add.
paramCntNumber of parameters to add.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_BuildParamSet()

struct OH_Huks_Result OH_Huks_BuildParamSet (struct OH_Huks_ParamSet ** paramSet)

Description Builds a parameter set.

Since: 9

Parameters

NameDescription
paramSetDouble pointer to the parameter set to build.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_CheckParamMatch()

struct OH_Huks_Result OH_Huks_CheckParamMatch (const struct OH_Huks_Param * baseParam, const struct OH_Huks_Param * param )

Description Checks whether two parameters are the same.

Since: 9

Parameters

NameDescription
baseParamPointer to the first parameter to compare.
paramPointer to the second parameter to compare.

Returns

Returns OH_HUKS_SUCCESS if the two parameters are the same; returns an error code otherwise.

OH_Huks_CopyParamSet()

struct OH_Huks_Result OH_Huks_CopyParamSet (const struct OH_Huks_ParamSet * fromParamSet, uint32_t fromParamSetSize, struct OH_Huks_ParamSet ** paramSet )

Description Copies a parameter set (deep copy).

Since: 9

Parameters

NameDescription
fromParamSetPointer to the parameter set to copy.
fromParamSetSizeSize of the memory occupied by the copied parameter set.
paramSetDouble pointer to the new parameter set generated.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_FreeKeyAliasSet()

void OH_Huks_FreeKeyAliasSet (struct OH_Huks_KeyAliasSet * keyAliasSet)

Description Frees a key alias set.

Since: 12

Parameters

NameDescription
keyAliasSetPointer to the key alias set to free.

OH_Huks_FreeParamSet()

void OH_Huks_FreeParamSet (struct OH_Huks_ParamSet ** paramSet)

Description Frees a parameter set.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to free.

OH_Huks_FreshParamSet()

struct OH_Huks_Result OH_Huks_FreshParamSet (struct OH_Huks_ParamSet * paramSet, bool isCopy )

Description Updates the data of the OH_Huks_Blob type in a parameter set.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to check.
isCopyWhether to copy the data. The value true means to update the address of the data of the OH_Huks_Blob type and copy the data to the parameter set. The value false means only update the address of the data of the OH_Huks_Blob type.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_GetParam()

struct OH_Huks_Result OH_Huks_GetParam (const struct OH_Huks_ParamSet * paramSet, uint32_t tag, struct OH_Huks_Param ** param )

Description Obtains a parameter from a parameter set.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to check.
tagName of the parameter to obtain.
paramDouble pointer to the obtained parameter.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_InitParamSet()

struct OH_Huks_Result OH_Huks_InitParamSet (struct OH_Huks_ParamSet ** paramSet)

Description Initializes a parameter set.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to initialize.

Returns

Returns OH_HUKS_SUCCESS if the operation is successful; returns an error code otherwise.

OH_Huks_IsParamSetTagValid()

struct OH_Huks_Result OH_Huks_IsParamSetTagValid (const struct OH_Huks_ParamSet * paramSet)

Description Checks whether the parameters in a parameter set are valid.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to check.

Returns

Returns OH_HUKS_SUCCESS if the parameters are valid. Otherwise, invalid or duplicate parameters are found.

OH_Huks_IsParamSetValid()

struct OH_Huks_Result OH_Huks_IsParamSetValid (const struct OH_Huks_ParamSet * paramSet, uint32_t size )

Description Checks whether a parameter set is of the valid size.

Since: 9

Parameters

NameDescription
paramSetPointer to the parameter set to check.
sizeMemory size occupied by the parameter set.

Returns

Returns OH_HUKS_SUCCESS if the size of the parameter set is valid; returns an error code otherwise.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Universal Keystore Kit (Key Management Service)

harmony 鸿蒙HuksKeyApi

harmony 鸿蒙HuksTypeApi

harmony 鸿蒙OH_Huks_Blob

harmony 鸿蒙OH_Huks_CertChain

harmony 鸿蒙OH_Huks_KeyAliasSet

harmony 鸿蒙OH_Huks_KeyInfo

harmony 鸿蒙OH_Huks_KeyMaterial25519

harmony 鸿蒙OH_Huks_KeyMaterialDh

harmony 鸿蒙OH_Huks_KeyMaterialDsa

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/FsY5fw