harmony 鸿蒙HUKS Error Codes

  • 2025-06-12
  • 浏览 (4)

HUKS Error Codes

NOTE

This topic describes only module-specific error codes. For details about universal error codes, see Universal Error Codes.

12000001 Feature Not Supported

Error Message

The ${messageInfo} is not supported.

Possible Causes The parameter used in the API, such as the algorithm, is not supported.

Solution

Modify the parameters in the API.

12000002 Missing Key Algorithm Parameter

Error Message

Failed to obtain the ${messageInfo}. It is not set in ParamSet.

Possible Causes

The key parameter is not set.

Solution

  1. Determine the missing parameter from the error message.
  2. Set the parameter.

12000003 Invalid Key Algorithm Parameter

Error Message

Invalid ${messageInfo}.

Possible Causes

An invalid parameter is found.

Solution

  1. Determine the invalid parameter from the error message.
  2. Correct the invalid parameter.

12000004 File Error

Error Message

A file error can be any of the following:

  • Insufficient storage space.
  • Invalid file size.
  • Failed to ${messageInfo}.

Possible Causes

The file operation failed.

Solution

  1. Check for insufficient space and file system errors.
  2. Clear the disk space.

12000005 IPC Error

Error Message

Any of the following occurs:

  • Failed to get messages from IPC.
  • IPC ${messageInfo}.

Possible Causes

The Inter-Process Communication (IPC) failed.

Solution

Locate and rectify the IPC failure.

12000006 Crypto Operation Failed

Error Message

Crypto engine error.

Possible Causes

The crypto operation fails. Possible causes include the following:

  1. The encryption and decryption failed due to incorrect ciphertext data.
  2. Incorrect key parameters exist.

Solution

  1. Check and correct the ciphertext data.
  2. Check and correct the key parameters.

12000007 Failed to Access the Key Due to Invalidated Credential

Error Message

This credential is invalidated permanently.

Possible Causes

The possible causes include the following:

  1. The key is configured with the user access control attribute and becomes invalid after the password is cleared.
  2. The key is configured with the user access control attribute and becomes invalid after a new biometric feature is enrolled.

Solution

  1. Locate the cause of the authentication failure based on the log.
  2. If the authentication fails due to the access control, the key cannot be used any longer.

12000008 Failed to Access the Key Due to a Failure in Authentication Token Verification

Error Message

The authentication token verification failed.

Possible Causes

The challenge value is incorrect.

Solution

  1. Check whether the challenge for user IAM authentication is correct.
  2. If the challenge value is incorrect, modify the assembly mode, use the data generated by HUKS to assembly the challenge value, and pass it to user IAM for authentication.

12000009 Key Access Timed Out

Error Message

This authentication token timed out.

Possible Causes

The authentication failed because the authentication timed out.

Solution

Initialize the key and perform the authentication again. Ensure that the difference between the current time and the authentication token generation time is less than the timeout interval.

12000010 Key Operation Sessions Reaches the Limit

Error Message

The number of key operation sessions has reached the limit.

Possible Causes

The number of concurrent key operation sessions has reached the maximum (15).

Solution

  1. Check whether there are multiple key session operations (init calls) for the same application. If yes, modify the code to avoid concurrent calling.
  2. If the key operation sessions are set up for different applications, wait until the sessions are released.

12000011 Entity Not Exist

Error Message

The entity does not exist.

Possible Causes

The key corresponding to the key alias does not exist.

Solution

  1. Check whether the key alias is correct.
  2. Check whether the key corresponding to the key alias is successfully generated.

12000012 External Error

Error Message

System external error.

Possible Causes

An external error, such as a hardware fault or file error, occurs.

Solution

Provide the error code and log information to the related party.

12000013 Credential Not Exist

Error Message

The credential does not exist.

Possible Causes

The credential, such as the PIN, fingerprint, or face image, is not enrolled.

Solution

Enroll the credential or change the authentication type bound to the key.

12000014 Insufficient Memory

Error Message

Any of the following occurs:

  • Insufficient memory.
  • Malloc failed.

Possible Causes

The system memory is insufficient, or the buffer allocated for the output parameter is too small.

Solution

  1. Release memory or restart the device.
  2. Check whether the buffer allocated for the output parameter is too small.

12000015 Failed to Invoke Other System Services

Error Message

Failed to obtain the ${messageInfo} information via UserIAM.

Possible Causes

The called system service has not started.

Solution

Wait for the system service to start and call the API again.

12000016 Lock Screen Password Not Set

Error Message

A device password is required but not set.

Possible Causes

The key is available only with a lock screen password, however, the lock screen password is not set.

Solution

Set a lock screen password for the device or change the key usage restrictions.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Universal Keystore Kit (Key Management Service)

harmony 鸿蒙HuksKeyApi

harmony 鸿蒙HuksParamSetApi

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

0  赞