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