Defines the macros, enumerated values, data structures, and error codes used by OpenHarmony Universal KeyStore (HUKS) APIs.
Defines the macros, enums, structs, and error codes used by OpenHarmony Universal KeyStore (HUKS) APIs.
\@syscap SystemCapability.Security.Huks
\@syscap SystemCapability.Security.Huks
**Since:**
**Since**:
9
9
...
@@ -16,74 +16,75 @@ Defines the macros, enumerated values, data structures, and error codes used by
...
@@ -16,74 +16,75 @@ Defines the macros, enumerated values, data structures, and error codes used by
### Files
### Files
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [native_huks_type.h](native__huks__type_8h.md) | Defines the enumerated variables, structures, and macros used in the HUKS APIs. <br>File to Include: <huks/native_huks/native_huks_type.h> |
| [native_huks_type.h](native__huks__type_8h.md) | Defines the enumerated variables, structs, and macros used in the HUKS APIs.<br>**File to include**: <huks/native_huks/native_huks_type.h><br>**Library**: libhuks_ndk.z.so|
### Structs
### Structs
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [OH_Huks_Result](_o_h___huks___result.md) | Defines the return data, including the result code and message. |
| [OH_Huks_Result](_o_h___huks___result.md) | Defines the returned status data, including the return code and message. |
| [OH_Huks_Blob](_o_h___huks___blob.md) | Defines the structure for storing data. |
| [OH_Huks_Blob](_o_h___huks___blob.md) | Defines the structure of the binary large object (BLOB) that stores data. |
| [OH_Huks_Param](_o_h___huks___param.md) | Defines the parameter structure in a parameter set. |
| [OH_Huks_Param](_o_h___huks___param.md) | Defines the structure of the parameters in a parameter set. |
| [OH_Huks_ParamSet](_o_h___huks___param_set.md) | Defines the structure of the parameter set. |
| [OH_Huks_ParamSet](_o_h___huks___param_set.md) | Defines the parameter set structure. |
| [OH_Huks_CertChain](_o_h___huks___cert_chain.md) | Defines the structure of the certificate chain. |
| [OH_Huks_CertChain](_o_h___huks___cert_chain.md) | Defines the certificate chain structure. |
| [OH_Huks_KeyInfo](_o_h___huks___key_info.md) | Defines the key information structure. |
| [OH_Huks_KeyInfo](_o_h___huks___key_info.md) | Defines the key information structure. |
| [OH_Huks_PubKeyInfo](_o_h___huks___pub_key_info.md) | Defines the structure of a public key. |
| [OH_Huks_PubKeyInfo](_o_h___huks___pub_key_info.md) | Defines the structure of a public key. |
| [OH_Huks_KeyMaterialRsa](_o_h___huks___key_material_rsa.md) | Defines the structure of an RSA key. |
| [OH_Huks_KeyMaterialRsa](_o_h___huks___key_material_rsa.md) | Defines the structure of an RSA key. |
| [OH_Huks_KeyMaterialEcc](_o_h___huks___key_material_ecc.md) | Defines the structure of an ECC key. |
| [OH_Huks_KeyMaterialEcc](_o_h___huks___key_material_ecc.md) | Defines the structure of an Elliptic Curve Cryptography (ECC) key. |
| [OH_Huks_KeyMaterialDsa](_o_h___huks___key_material_dsa.md) | Defines the structure of a DSA key. |
| [OH_Huks_KeyMaterialDsa](_o_h___huks___key_material_dsa.md) | Defines the structure of a DSA key. |
| [OH_Huks_KeyMaterialDh](_o_h___huks___key_material_dh.md) | Defines the structure of a DH key. |
| [OH_Huks_KeyMaterialDh](_o_h___huks___key_material_dh.md) | Defines the structure of a Diffie-Hellman (DH) key. |
| [OH_Huks_KeyMaterial25519](_o_h___huks___key_material25519.md) | Defines the structure of a 25519 key. |
| [OH_Huks_KeyMaterial25519](_o_h___huks___key_material25519.md) | Defines the structure of a 25519 key. |
| [OH_Huks_AlgSuite](#oh_huks_algsuite) { OH_HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING = 1, OH_HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING = 2 } | Enumerates the algorithm suites required for ciphertext imports. |
| [OH_Huks_AlgSuite](#oh_huks_algsuite) { <br>OH_HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING = 1, <br>OH_HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING = 2 <br>} | Enumerates the algorithm suites for the import of a wrapped key. |
| [OH_Huks_ImportKeyType](#oh_huks_importkeytype) { OH_HUKS_KEY_TYPE_PUBLIC_KEY = 0, OH_HUKS_KEY_TYPE_PRIVATE_KEY = 1, OH_HUKS_KEY_TYPE_KEY_PAIR = 2 } | Enumerates the types of keys to import. By default, a public key is imported. This field is not required when a symmetric key is imported. |
| [OH_Huks_ImportKeyType](#oh_huks_importkeytype) { <br>OH_HUKS_KEY_TYPE_PUBLIC_KEY = 0, <br>OH_HUKS_KEY_TYPE_PRIVATE_KEY = 1, <br>OH_HUKS_KEY_TYPE_KEY_PAIR = 2 <br>} | Enumerates the types of the key to import. By default, a public key is imported. This field is not required when a symmetric key is imported. |
| [OH_Huks_RsaPssSaltLenType](#oh_huks_rsapsssaltlentype) { <br> OH_HUKS_RSA_PSS_SALT_LEN_DIGEST = 0, OH_HUKS_RSA_PSS_SALT_LEN_MAX = 1 <br>} | Enumerates the salt length types when the PSS padding mode is used in RSA signing or signature verification.|
| [OH_Huks_UserAuthType](#oh_huks_userauthtype) { <br>OH_HUKS_USER_AUTH_TYPE_FINGERPRINT = 1 << 0, <br>OH_HUKS_USER_AUTH_TYPE_FACE = 1 << 1, <br>OH_HUKS_USER_AUTH_TYPE_PIN = 1 << 2 <br>} | Enumerates the user authentication types in key access control. |
| [OH_Huks_ChallengeType](#oh_huks_challengetype) { OH_HUKS_CHALLENGE_TYPE_NORMAL = 0, OH_HUKS_CHALLENGE_TYPE_CUSTOM = 1, OH_HUKS_CHALLENGE_TYPE_NONE = 2 } | Enumerates the types of the challenges generated when a key is used. |
| [OH_Huks_AuthAccessType](#oh_huks_authaccesstype) { <br>OH_HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0, <br>OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1 <br>} | Enumerates the rules for invalidating a key. |
| [OH_Huks_ChallengePosition](#oh_huks_challengeposition) { OH_HUKS_CHALLENGE_POS_0 = 0, OH_HUKS_CHALLENGE_POS_1, OH_HUKS_CHALLENGE_POS_2, OH_HUKS_CHALLENGE_POS_3 } | Enumerates the positions of the 8-byte valid value in a custom challenge generated. |
| [OH_Huks_ChallengeType](#oh_huks_challengetype) { <br>OH_HUKS_CHALLENGE_TYPE_NORMAL = 0, <br>OH_HUKS_CHALLENGE_TYPE_CUSTOM = 1, <br>OH_HUKS_CHALLENGE_TYPE_NONE = 2 <br>} | Enumerates the types of the challenge generated when a key is used. |
| [OH_Huks_SecureSignType](#oh_huks_securesigntype) { OH_HUKS_SECURE_SIGN_WITH_AUTHINFO = 1 } | Enumerates the signature types of the keys generated or imported. |
| [OH_Huks_ChallengePosition](#oh_huks_challengeposition) { <br>OH_HUKS_CHALLENGE_POS_0 = 0, <br>OH_HUKS_CHALLENGE_POS_1, <br>OH_HUKS_CHALLENGE_POS_2, <br>OH_HUKS_CHALLENGE_POS_3 <br>} | Enumerates the positions of the 8-byte valid value in a custom challenge generated. |
| [OH_Huks_SecureSignType](#oh_huks_securesigntype) { OH_HUKS_SECURE_SIGN_WITH_AUTHINFO = 1 } | Enumerates the signature types of the key generated or imported. |
| OH_HUKS_CHALLENGE_TYPE_NORMAL | Normal challenge, which is of 32 bytes by default. |
| OH_HUKS_CHALLENGE_TYPE_NORMAL | Normal challenge, which is of 32 bytes by default.|
| OH_HUKS_CHALLENGE_TYPE_CUSTOM | Custom challenge, which supports only one authentication for multiple keys. The valid value of a custom challenge is of 8 bytes. |
| OH_HUKS_CHALLENGE_TYPE_CUSTOM | Custom challenge, which supports only one authentication for multiple keys. The valid value of a custom challenge is of 8 bytes.|
| OH_HUKS_CHALLENGE_TYPE_NONE | Challenge is not required. |
| OH_HUKS_CHALLENGE_TYPE_NONE | Challenge is not required.|
| OH_HUKS_ECC_KEY_SIZE_224 | ECC key of 224 bits.|
| OH_HUKS_ECC_KEY_SIZE_256 | ECC key of 256 bits. |
| OH_HUKS_ECC_KEY_SIZE_256 | ECC key of 256 bits.|
| OH_HUKS_ECC_KEY_SIZE_384 | ECC key of 384 bits. |
| OH_HUKS_ECC_KEY_SIZE_384 | ECC key of 384 bits.|
| OH_HUKS_ECC_KEY_SIZE_521 | ECC key of 521 bits. |
| OH_HUKS_ECC_KEY_SIZE_521 | ECC key of 521 bits.|
| OH_HUKS_AES_KEY_SIZE_128 | Advanced Encryption Standard (AES) key of 128 bits. |
| OH_HUKS_AES_KEY_SIZE_128 | AES key of 128 bits.|
| OH_HUKS_AES_KEY_SIZE_192 | AES key of 192 bits. |
| OH_HUKS_AES_KEY_SIZE_192 | AES key of 192 bits.|
| OH_HUKS_AES_KEY_SIZE_256 | AES key of 256 bits. |
| OH_HUKS_AES_KEY_SIZE_256 | AES key of 256 bits.|
| OH_HUKS_AES_KEY_SIZE_512 | AES key of 512 bits. |
| OH_HUKS_AES_KEY_SIZE_512 | AES key of 512 bits.|
| OH_HUKS_CURVE25519_KEY_SIZE_256 | Curve25519 key of 256 bits. |
| OH_HUKS_CURVE25519_KEY_SIZE_256 | Curve25519 key of 256 bits.|
| OH_HUKS_DH_KEY_SIZE_2048 | Diffie-Hellman (DH) key of 2048 bits. |
| OH_HUKS_DH_KEY_SIZE_2048 | DH key of 2048 bits.|
| OH_HUKS_DH_KEY_SIZE_3072 | DH key of 3072 bits. |
| OH_HUKS_DH_KEY_SIZE_3072 | DH key of 3072 bits.|
| OH_HUKS_DH_KEY_SIZE_4096 | DH key of 4096 bits. |
| OH_HUKS_DH_KEY_SIZE_4096 | DH key of 4096 bits.|
| OH_HUKS_SM2_KEY_SIZE_256 | ShangMi2 (SM2) key of 256 bits. |
| OH_HUKS_SM2_KEY_SIZE_256 | SM2 key of 256 bits.|
| OH_HUKS_SM4_KEY_SIZE_128 | ShangMi4 (SM4) key of 128 bits. |
| OH_HUKS_SM4_KEY_SIZE_128 | SM4 key of 128 bits.|
### OH_Huks_KeyStorageType
### OH_Huks_KeyStorageType
```
```
enum OH_Huks_KeyStorageType
enum OH_Huks_KeyStorageType
```
```
**Description**<br>
**Description**
Enumerates the key storage modes.
Enumerates the key storage types.
| Name | Description |
| Name | Description|
| -------- | -------- |
| -------- | -------- |
| OH_HUKS_STORAGE_TEMP | The key is managed locally. |
| OH_HUKS_STORAGE_TEMP | The key is managed locally.|
| OH_HUKS_STORAGE_PERSISTENT | The key is managed by the HUKS service. |
| OH_HUKS_STORAGE_PERSISTENT | The key is managed by the HUKS service.|
| OH_HUKS_STORAGE_ONLY_USED_IN_HUKS | The key is stored only in the HUKS.|
| OH_HUKS_STORAGE_KEY_EXPORT_ALLOWED | The key is exported from the HUKS and is not stored.|
### OH_Huks_SecureSignType
### OH_Huks_SecureSignType
```
```
enum OH_Huks_SecureSignType
enum OH_Huks_SecureSignType
```
```
**Description**<br>
**Description**
Enumerates the signature types of the keys generated or imported.
Enumerates the signature types of the key generated or imported.
| Name | Description |
| Name | Description|
| -------- | -------- |
| -------- | -------- |
| OH_HUKS_SECURE_SIGN_WITH_AUTHINFO | The signature carries authentication information. This field is specified when a key is generated or imported. When the key is used to sign data, the data will be added with the authentication information and then be signed. |
| OH_HUKS_SECURE_SIGN_WITH_AUTHINFO | The signature carries authentication information. This field is specified when a key is generated or imported. When the key is used for signing, the data will be added with the authentication information and then be signed.|
### OH_Huks_Tag
### OH_Huks_Tag
```
```
enum OH_Huks_Tag
enum OH_Huks_Tag
```
```
**Description**<br>
**Description**
Enumerates the tag values used in parameter sets.
Enumerates the tag values used in the parameter set.
| Name | Description |
| -------- | -------- |
| Name | Description|
| OH_HUKS_TAG_ALGORITHM | Tags for key parameters. The value range is 1 to 200. Algorithm. |
| OH_HUKS_TAG_INFO | Information generated during key derivation. |
| OH_HUKS_TAG_NONCE | Field for key encryption and decryption.|
| OH_HUKS_TAG_SALT | Salt value used for key derivation. |
| OH_HUKS_TAG_IV | Initialized vector (IV).|
| OH_HUKS_TAG_ITERATION | Number of iterations for key derivation. |
| OH_HUKS_TAG_INFO | Information generated during key derivation.|
| OH_HUKS_TAG_KEY_GENERATE_TYPE | Type of the generated key. For details, see [OH_Huks_KeyGenerateType](#oh_huks_keygeneratetype). |
| OH_HUKS_TAG_SALT | Salt value used for key derivation.|
| OH_HUKS_TAG_AGREE_ALG | Algorithm used in key agreement. |
| OH_HUKS_TAG_ITERATION | Number of iterations for key derivation.|
| OH_HUKS_TAG_AGREE_PUBLIC_KEY_IS_KEY_ALIAS | Alias of the public key used for key agreement. |
| OH_HUKS_TAG_KEY_GENERATE_TYPE | Type of the generated key. For details, see [OH_Huks_KeyGenerateType](#oh_huks_keygeneratetype).|
| OH_HUKS_TAG_AGREE_PRIVATE_KEY_ALIAS | Alias of the private key used for key agreement. |
| OH_HUKS_TAG_AGREE_ALG | Algorithm used in key agreement.|
| OH_HUKS_TAG_AGREE_PUBLIC_KEY | Public key used for key agreement. |
| OH_HUKS_TAG_AGREE_PUBLIC_KEY_IS_KEY_ALIAS | Alias of the public key used for key agreement.|
| OH_HUKS_TAG_KEY_ALIAS | Alias of the key. |
| OH_HUKS_TAG_AGREE_PRIVATE_KEY_ALIAS | Alias of the private key used for key agreement.|
| OH_HUKS_TAG_DERIVE_KEY_SIZE | Size of the derived key. |
| OH_HUKS_TAG_AGREE_PUBLIC_KEY | Public key used for key agreement.|
| OH_HUKS_TAG_IMPORT_KEY_TYPE | Type of the key to import. For details, see [OH_Huks_ImportKeyType](#oh_huks_importkeytype). |
| OH_HUKS_TAG_KEY_ALIAS | Key alias.|
| OH_HUKS_TAG_UNWRAP_ALGORITHM_SUITE | Algorithm suite required for encrypted imports. |
| OH_HUKS_TAG_DERIVE_KEY_SIZE | Size of the derived key.|
| OH_HUKS_TAG_ALL_USERS | Tags for access control and user authentication. The value range is 301 to 500. All users in the multi-user scenario. |
| OH_HUKS_TAG_IMPORT_KEY_TYPE | Type of the key to import. For details, see {@link OH_Huks_ImportKeyType}.|
| OH_HUKS_TAG_USER_ID | Multi-user ID. |
| OH_HUKS_TAG_UNWRAP_ALGORITHM_SUITE | Algorithm suite required for encrypted imports.|
| OH_HUKS_TAG_NO_AUTH_REQUIRED | Specifies whether key access control is required. |
| OH_HUKS_TAG_DERIVED_AGREED_KEY_STORAGE_FLAG | Storage type of the derived/agreed key.|
| OH_HUKS_TAG_USER_AUTH_TYPE | User authentication type in key access control. |
| OH_HUKS_TAG_RSA_PSS_SALT_LEN_TYPE | Salt length type when the PSS padding mode is used for the RSA algorithm.|
| OH_HUKS_TAG_AUTH_TIMEOUT | Timeout duration for key access. |
| Tags for key access control and authentication: 300 to 500 | |
| OH_HUKS_TAG_AUTH_TOKEN | Authentication token for the key. |
| OH_HUKS_TAG_ALL_USERS | All users in multi-user scenarios. |
| OH_HUKS_TAG_KEY_AUTH_ACCESS_TYPE | Access control type. For details, see [OH_Huks_AuthAccessType](#oh_huks_authaccesstype). This parameter must be set together with the user authentication type. |
| OH_HUKS_TAG_USER_ID | Multi-user ID.|
| OH_HUKS_TAG_KEY_SECURE_SIGN_TYPE | Signature type for the key to be generated or imported. |
| OH_HUKS_TAG_NO_AUTH_REQUIRED | Whether key access control is required.|
| OH_HUKS_TAG_CHALLENGE_TYPE | Challenge type. For details, see [OH_Huks_ChallengeType](#oh_huks_challengetype). |
| OH_HUKS_TAG_USER_AUTH_TYPE | User authentication type in key access control.|
| OH_HUKS_TAG_CHALLENGE_POS | Position of the 8-byte valid value in a custom challenge. For details, see [OH_Huks_ChallengePosition](#oh_huks_challengeposition). |
| OH_HUKS_TAG_AUTH_TIMEOUT | Timeout duration for key access.|
| OH_HUKS_TAG_ATTESTATION_CHALLENGE | Tags for key attestation. The value range is 501 to 600. Challenge value used in the attestation. |
| OH_HUKS_TAG_AUTH_TOKEN | Authentication token for the key.|
| OH_HUKS_TAG_ATTESTATION_APPLICATION_ID | Application ID used in the attestation. |
| OH_HUKS_TAG_KEY_AUTH_ACCESS_TYPE | Access control type. For details, see {@link OH_Huks_AuthAccessType}. This parameter must be set together with the user authentication type.|
| OH_HUKS_TAG_ATTESTATION_ID_ALIAS | Alias of the key. |
| OH_HUKS_TAG_KEY_SECURE_SIGN_TYPE | Signature type of the key generated or imported.|
| OH_HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO | Security level used in the attestation. |
| OH_HUKS_TAG_CHALLENGE_TYPE | Type of the challenge generated for a key. For details, see {@link OH_Huks_ChallengeType}.|
| OH_HUKS_TAG_ATTESTATION_ID_VERSION_INFO | Version information used in the attestation. |
| OH_HUKS_TAG_CHALLENGE_POS | Position of the 8-byte valid value in a custom challenge. For details, see {@link OH_Huks_ChallengePosition}.|
| OH_HUKS_TAG_IS_KEY_ALIAS | 601 to 1000 are reserved for other tags.<br/>Extended tags. The value range is 1001 to 9999. Specifies whether it is a key alias. |
| H_HUKS_TAG_KEY_AUTH_PURPOSE | Type of the key authentication purpose.|
| OH_HUKS_TAG_KEY_STORAGE_FLAG | Key storage mode. For details, see [OH_Huks_KeyStorageType](#oh_huks_keystoragetype). |
| Tags for key attestation: 501 to 600 | |
| OH_HUKS_TAG_IS_ALLOWED_WRAP | Specifies whether to allow the key to be wrapped. |
| OH_HUKS_TAG_ATTESTATION_CHALLENGE | Challenge value used for key attestation. |
| OH_HUKS_TAG_KEY_WRAP_TYPE | Key wrap type. |
| OH_HUKS_TAG_ATTESTATION_APPLICATION_ID | ID of the application, to which the key belongs, in key attestation.|
| OH_HUKS_TAG_KEY_AUTH_ID | Authentication ID. |
| OH_HUKS_TAG_ATTESTATION_ID_ALIAS | Key alias.|
| OH_HUKS_TAG_KEY_ROLE | Role of the key. |
| OH_HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO | Security level used in key attestation.|
| OH_HUKS_TAG_KEY_FLAG | Key flag. For details, see [OH_Huks_KeyFlag](#oh_huks_keyflag). |
| OH_HUKS_TAG_ATTESTATION_ID_VERSION_INFO | Version information used in key attestation.|
| OH_HUKS_TAG_IS_ASYNCHRONIZED | Specifies whether this API is asynchronous. |
| 601 to 1000 are reserved. Extended tags: 1001 to 9999 | |
| OH_HUKS_TAG_KEY_DOMAIN | Key domain. |
| OH_HUKS_TAG_IS_KEY_ALIAS | Whether the key alias is used. |
| OH_HUKS_TAG_SYMMETRIC_KEY_DATA | 11000 to 12000 are reserved.<br/>20001 to N are reserved for other tags. Symmetric key data. |
| OH_HUKS_TAG_KEY_STORAGE_FLAG | Key storage mode. For details, see [OH_Huks_KeyStorageType](#oh_huks_keystoragetype).|
| OH_HUKS_TAG_ASYMMETRIC_PUBLIC_KEY_DATA | Public key data of the asymmetric key pair. |
| OH_HUKS_TAG_IS_ALLOWED_WRAP | Whether to allow the key to be wrapped.|
| OH_HUKS_TAG_ASYMMETRIC_PRIVATE_KEY_DATA | Private key data of the asymmetric key pair. |
| OH_HUKS_TAG_KEY_WRAP_TYPE | Key wrap type.|
| OH_HUKS_TAG_KEY_AUTH_ID | Authentication ID.|
| OH_HUKS_TAG_KEY_ROLE | Role of the key.|
| OH_HUKS_TAG_KEY_FLAG | Key flag. For details, see [OH_Huks_KeyFlag](#oh_huks_keyflag).|
| OH_HUKS_TAG_IS_ASYNCHRONIZED | Whether the invocation is asynchronous.|
| OH_HUKS_TAG_KEY_DOMAIN | Key domain.|
| 11000 to 12000 are reserved. Reserved values for other tags: 20001 - N | |
| [OH_Huks_AlgSuite](_huks_type_api.md#oh_huks_algsuite) { OH_HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING = 1, OH_HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING = 2 } | Enumerates the algorithm suites required for ciphertext imports. |
| [OH_Huks_AlgSuite](_huks_type_api.md#oh_huks_algsuite) { <br>OH_HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING = 1, <br>OH_HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING = 2 <br>} | Enumerates the algorithm suites for the import of a wrapped key. |
| [OH_Huks_ImportKeyType](_huks_type_api.md#oh_huks_importkeytype) { OH_HUKS_KEY_TYPE_PUBLIC_KEY = 0, OH_HUKS_KEY_TYPE_PRIVATE_KEY = 1, OH_HUKS_KEY_TYPE_KEY_PAIR = 2 } | Enumerates the types of keys to import. By default, a public key is imported. This field is not required when a symmetric key is imported. |
| [OH_Huks_ImportKeyType](_huks_type_api.md#oh_huks_importkeytype) { <br>OH_HUKS_KEY_TYPE_PUBLIC_KEY = 0, <br>OH_HUKS_KEY_TYPE_PRIVATE_KEY = 1, <br>OH_HUKS_KEY_TYPE_KEY_PAIR = 2 <br>}| Enumerates the types of the key to import. By default, a public key is imported. This field is not required when a symmetric key is imported. |
| [OH_Huks_RsaPssSaltLenType](_huks_type_api.md#oh_huks_rsapsssaltlentype) { <br> OH_HUKS_RSA_PSS_SALT_LEN_DIGEST = 0, OH_HUKS_RSA_PSS_SALT_LEN_MAX = 1 <br>} | Enumerates the salt length types when the PSS padding mode is used in RSA signing or signature verification.|
| [OH_Huks_UserAuthType](_huks_type_api.md#oh_huks_userauthtype) { <br>OH_HUKS_USER_AUTH_TYPE_FINGERPRINT = 1 << 0, <br>OH_HUKS_USER_AUTH_TYPE_FACE = 1 << 1, <br>OH_HUKS_USER_AUTH_TYPE_PIN = 1 << 2 <br>} | Enumerates the user authentication types in key access control. |
| [OH_Huks_ChallengeType](_huks_type_api.md#oh_huks_challengetype) { OH_HUKS_CHALLENGE_TYPE_NORMAL = 0, OH_HUKS_CHALLENGE_TYPE_CUSTOM = 1, OH_HUKS_CHALLENGE_TYPE_NONE = 2 } | Enumerates the types of the challenges generated when a key is used. |
| [OH_Huks_AuthAccessType](_huks_type_api.md#oh_huks_authaccesstype) { <br>OH_HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0, <br>OH_HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1 <br>} | Enumerates the rules for invalidating a key. |
| [OH_Huks_ChallengePosition](_huks_type_api.md#oh_huks_challengeposition) { OH_HUKS_CHALLENGE_POS_0 = 0, OH_HUKS_CHALLENGE_POS_1, OH_HUKS_CHALLENGE_POS_2, OH_HUKS_CHALLENGE_POS_3 } | Enumerates the positions of the 8-byte valid value in a custom challenge generated. |
| [OH_Huks_ChallengeType](_huks_type_api.md#oh_huks_challengetype) { <br>OH_HUKS_CHALLENGE_TYPE_NORMAL = 0, <br>OH_HUKS_CHALLENGE_TYPE_CUSTOM = 1, <br>OH_HUKS_CHALLENGE_TYPE_NONE = 2 <br>} | Enumerates the types of the challenge generated when a key is used. |
| [OH_Huks_SecureSignType](_huks_type_api.md#oh_huks_securesigntype) { OH_HUKS_SECURE_SIGN_WITH_AUTHINFO = 1 } | Enumerates the signature types of the keys generated or imported. |
| [OH_Huks_ChallengePosition](_huks_type_api.md#oh_huks_challengeposition) { <br>OH_HUKS_CHALLENGE_POS_0 = 0, <br>OH_HUKS_CHALLENGE_POS_1, <br>OH_HUKS_CHALLENGE_POS_2, <br>OH_HUKS_CHALLENGE_POS_3 <br>} | Enumerates the positions of the 8-byte valid value in a custom challenge generated. |
| [OH_Huks_SecureSignType](_huks_type_api.md#oh_huks_securesigntype) { OH_HUKS_SECURE_SIGN_WITH_AUTHINFO = 1 } | Enumerates the signature types of the key generated or imported. |