1e41f4b71Sopenharmony_ci# HUKS Error Codes
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci> **NOTE**
4e41f4b71Sopenharmony_ci>
5e41f4b71Sopenharmony_ci> This topic describes only module-specific error codes. For details about universal error codes, see [Universal Error Codes](../errorcode-universal.md).
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci## 12000001 Feature Not Supported
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci**Error Message**
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciThe `${messageInfo}` is not supported.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci**Possible Causes**
14e41f4b71Sopenharmony_ciThe parameter used in the API, such as the algorithm, is not supported.
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci**Solution**
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ciModify the parameters in the API.
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci## 12000002 Missing Key Algorithm Parameter
21e41f4b71Sopenharmony_ci**Error Message**
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ciFailed to obtain the `${messageInfo}`. It is not set in ParamSet.
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci**Possible Causes**
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ciThe key parameter is not set.
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci**Solution**
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci1. Determine the missing parameter from the error message.
32e41f4b71Sopenharmony_ci2. Set the parameter.
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci## 12000003 Invalid Key Algorithm Parameter
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci**Error Message**
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ciInvalid `${messageInfo}`.
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci**Possible Causes**
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ciAn invalid parameter is found.
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci**Solution**
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci1. Determine the invalid parameter from the error message.
47e41f4b71Sopenharmony_ci2. Correct the invalid parameter.
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci## 12000004 File Error
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ci**Error Message**
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ciA file error can be any of the following: 
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ci- Insufficient storage space.
56e41f4b71Sopenharmony_ci- Invalid file size.
57e41f4b71Sopenharmony_ci- Failed to `${messageInfo}`.
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci**Possible Causes**
61e41f4b71Sopenharmony_ci
62e41f4b71Sopenharmony_ciThe file operation failed.
63e41f4b71Sopenharmony_ci
64e41f4b71Sopenharmony_ci**Solution**
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci1. Check for insufficient space and file system errors.
67e41f4b71Sopenharmony_ci2. Clear the disk space.
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci## 12000005 IPC Error
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ci**Error Message**
72e41f4b71Sopenharmony_ci
73e41f4b71Sopenharmony_ciAny of the following occurs:
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci- Failed to get messages from IPC.
76e41f4b71Sopenharmony_ci- IPC `${messageInfo}`.
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci**Possible Causes**
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ciThe Inter-Process Communication (IPC) failed.
81e41f4b71Sopenharmony_ci
82e41f4b71Sopenharmony_ci**Solution**
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ciLocate and rectify the IPC failure.
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ci## 12000006 Crypto Operation Failed
87e41f4b71Sopenharmony_ci
88e41f4b71Sopenharmony_ci**Error Message**
89e41f4b71Sopenharmony_ci
90e41f4b71Sopenharmony_ciCrypto engine error.
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci**Possible Causes**
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ciThe crypto operation fails. Possible causes include the following:
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ci1. The encryption and decryption failed due to incorrect ciphertext data.
97e41f4b71Sopenharmony_ci2. Incorrect key parameters exist.
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci**Solution**
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ci1. Check and correct the ciphertext data.
102e41f4b71Sopenharmony_ci2. Check and correct the key parameters.
103e41f4b71Sopenharmony_ci
104e41f4b71Sopenharmony_ci## 12000007 Failed to Access the Key Due to Invalidated Credential
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_ci**Error Message**
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ciThis credential is invalidated permanently.
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ci**Possible Causes**
111e41f4b71Sopenharmony_ci
112e41f4b71Sopenharmony_ciThe possible causes include the following:
113e41f4b71Sopenharmony_ci
114e41f4b71Sopenharmony_ci1. The key is configured with the user access control attribute and becomes invalid after the password is cleared.
115e41f4b71Sopenharmony_ci2. The key is configured with the user access control attribute and becomes invalid after a new biometric feature is enrolled.
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci**Solution**
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci1. Locate the cause of the authentication failure based on the log.
120e41f4b71Sopenharmony_ci2. If the authentication fails due to the access control, the key cannot be used any longer.
121e41f4b71Sopenharmony_ci
122e41f4b71Sopenharmony_ci## 12000008 Failed to Access the Key Due to a Failure in Authentication Token Verification
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci**Error Message**
125e41f4b71Sopenharmony_ci
126e41f4b71Sopenharmony_ciThe authentication token verification failed.
127e41f4b71Sopenharmony_ci
128e41f4b71Sopenharmony_ci**Possible Causes**
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_ciThe challenge value is incorrect.
131e41f4b71Sopenharmony_ci
132e41f4b71Sopenharmony_ci**Solution**
133e41f4b71Sopenharmony_ci
134e41f4b71Sopenharmony_ci1. Check whether the challenge for user IAM authentication is correct.
135e41f4b71Sopenharmony_ci2. 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.
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci## 12000009 Key Access Timed Out
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ci**Error Message**
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ciThis authentication token timed out.
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci**Possible Causes**
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ciThe authentication failed because the authentication timed out.
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci**Solution**
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ciInitialize 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.
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci## 12000010 Key Operation Sessions Reaches the Limit
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ci**Error Message**
154e41f4b71Sopenharmony_ci
155e41f4b71Sopenharmony_ciThe number of key operation sessions has reached the limit.
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci**Possible Causes**
158e41f4b71Sopenharmony_ci
159e41f4b71Sopenharmony_ciThe number of concurrent key operation sessions has reached the maximum (15).
160e41f4b71Sopenharmony_ci
161e41f4b71Sopenharmony_ci**Solution**
162e41f4b71Sopenharmony_ci
163e41f4b71Sopenharmony_ci1. Check whether there are multiple key session operations (**init** calls) for the same application. If yes, modify the code to avoid concurrent calling.
164e41f4b71Sopenharmony_ci2. If the key operation sessions are set up for different applications, wait until the sessions are released.
165e41f4b71Sopenharmony_ci
166e41f4b71Sopenharmony_ci## 12000011 Entity Not Exist
167e41f4b71Sopenharmony_ci
168e41f4b71Sopenharmony_ci**Error Message**
169e41f4b71Sopenharmony_ci
170e41f4b71Sopenharmony_ciThe entity does not exist.
171e41f4b71Sopenharmony_ci
172e41f4b71Sopenharmony_ci**Possible Causes**
173e41f4b71Sopenharmony_ci
174e41f4b71Sopenharmony_ciThe key corresponding to the key alias does not exist.
175e41f4b71Sopenharmony_ci
176e41f4b71Sopenharmony_ci**Solution**
177e41f4b71Sopenharmony_ci
178e41f4b71Sopenharmony_ci1. Check whether the key alias is correct.
179e41f4b71Sopenharmony_ci2. Check whether the key corresponding to the key alias is successfully generated.
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci## 12000012 External Error
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci**Error Message**
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ciSystem external error.
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci**Possible Causes**
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ciAn external error, such as a hardware fault or file error, occurs.
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci**Solution**
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ciProvide the error code and log information to the related party.
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci## 12000013 Credential Not Exist
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci**Error Message**
198e41f4b71Sopenharmony_ci
199e41f4b71Sopenharmony_ciThe credential does not exist.
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci**Possible Causes**
202e41f4b71Sopenharmony_ci
203e41f4b71Sopenharmony_ciThe credential, such as the PIN, fingerprint, or face image, is not enrolled.
204e41f4b71Sopenharmony_ci
205e41f4b71Sopenharmony_ci**Solution**
206e41f4b71Sopenharmony_ci
207e41f4b71Sopenharmony_ciEnroll the credential or change the authentication type bound to the key.
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ci## 12000014 Insufficient Memory
210e41f4b71Sopenharmony_ci
211e41f4b71Sopenharmony_ci**Error Message**
212e41f4b71Sopenharmony_ci
213e41f4b71Sopenharmony_ciAny of the following occurs:
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci- Insufficient memory.
216e41f4b71Sopenharmony_ci- Malloc failed.
217e41f4b71Sopenharmony_ci
218e41f4b71Sopenharmony_ci**Possible Causes**
219e41f4b71Sopenharmony_ci
220e41f4b71Sopenharmony_ciThe system memory is insufficient, or the buffer allocated for the output parameter is too small.
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ci**Solution**
223e41f4b71Sopenharmony_ci
224e41f4b71Sopenharmony_ci1. Release memory or restart the device.
225e41f4b71Sopenharmony_ci2. Check whether the buffer allocated for the output parameter is too small.
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ci## 12000015 Failed to Invoke Other System Services
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci**Error Message**
230e41f4b71Sopenharmony_ci
231e41f4b71Sopenharmony_ciFailed to obtain the `${messageInfo}` information via UserIAM.
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci**Possible Causes**
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ciThe called system service has not started.
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ci**Solution**
238e41f4b71Sopenharmony_ci
239e41f4b71Sopenharmony_ciWait for the system service to start and call the API again.
240e41f4b71Sopenharmony_ci
241e41f4b71Sopenharmony_ci## 12000016 Lock Screen Password Not Set
242e41f4b71Sopenharmony_ci
243e41f4b71Sopenharmony_ci**Error Message**
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ciA device password is required but not set.
246e41f4b71Sopenharmony_ci
247e41f4b71Sopenharmony_ci**Possible Causes**
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_ciThe key is available only with a lock screen password, however, the lock screen password is not set.
250e41f4b71Sopenharmony_ci
251e41f4b71Sopenharmony_ci**Solution**
252e41f4b71Sopenharmony_ci
253e41f4b71Sopenharmony_ciSet a lock screen password for the device or change the key usage restrictions.
254