1/*
2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit UniversalKeystoreKit
19 */
20
21import type { AsyncCallback } from './@ohos.base';
22
23/**
24 * OpenHarmony Universal KeyStore
25 *
26 * @namespace huks
27 * @syscap SystemCapability.Security.Huks.Core
28 * @since 8
29 */
30/**
31 * OpenHarmony Universal KeyStore
32 *
33 * @namespace huks
34 * @syscap SystemCapability.Security.Huks.Core
35 * @atomicservice
36 * @since 11
37 */
38declare namespace huks {
39  /**
40   * Generate Key.
41   *
42   * @param { string } keyAlias - keyAlias indicates the key's name.
43   * @param { HuksOptions } options - options indicates the properties of the key.
44   * @param { AsyncCallback<HuksResult> } callback - the callback of generateKey.
45   * @syscap SystemCapability.Security.Huks.Extension
46   * @since 8
47   * @deprecated since 9
48   * @useinstead ohos.security.huks.generateKeyItem
49   */
50  function generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
51
52  /**
53   * Generate Key.
54   *
55   * @param { string } keyAlias - keyAlias indicates the key's name.
56   * @param { HuksOptions } options - options indicates the properties of the key.
57   * @returns { Promise<HuksResult> } the promise returned by the function.
58   * @syscap SystemCapability.Security.Huks.Extension
59   * @since 8
60   * @deprecated since 9
61   * @useinstead ohos.security.huks.generateKeyItem
62   */
63  function generateKey(keyAlias: string, options: HuksOptions): Promise<HuksResult>;
64
65  /**
66   * Generate Key.
67   *
68   * @param { string } keyAlias - keyAlias indicates the key's name.
69   * @param { HuksOptions } options - options indicates the properties of the key.
70   * @param { AsyncCallback<void> } callback - the callback of generateKeyItem.
71   * @throws { BusinessError } 401 - Parameter error. Possible causes:
72   *                                 1. Mandatory parameters are left unspecified.
73   *                                 2. Incorrect parameter types.
74   *                                 3. Parameter verification failed.
75   * @throws { BusinessError } 801 - api is not supported
76   * @throws { BusinessError } 12000001 - algorithm mode is not supported
77   * @throws { BusinessError } 12000002 - algorithm param is missing
78   * @throws { BusinessError } 12000003 - algorithm param is invalid
79   * @throws { BusinessError } 12000004 - operating file failed
80   * @throws { BusinessError } 12000005 - IPC communication failed
81   * @throws { BusinessError } 12000006 - error occurred in crypto engine
82   * @throws { BusinessError } 12000012 - external error
83   * @throws { BusinessError } 12000013 - queried credential does not exist
84   * @throws { BusinessError } 12000014 - memory is insufficient
85   * @throws { BusinessError } 12000015 - call service failed
86   * @syscap SystemCapability.Security.Huks.Core
87   * @since 9
88   */
89  /**
90   * Generate Key.
91   *
92   * @param { string } keyAlias - keyAlias indicates the key's name.
93   * @param { HuksOptions } options - options indicates the properties of the key.
94   * @param { AsyncCallback<void> } callback - the callback of generateKeyItem.
95   * @throws { BusinessError } 401 - Parameter error. Possible causes:
96   *                                 1. Mandatory parameters are left unspecified.
97   *                                 2. Incorrect parameter types.
98   *                                 3. Parameter verification failed.
99   * @throws { BusinessError } 801 - api is not supported
100   * @throws { BusinessError } 12000001 - algorithm mode is not supported
101   * @throws { BusinessError } 12000002 - algorithm param is missing
102   * @throws { BusinessError } 12000003 - algorithm param is invalid
103   * @throws { BusinessError } 12000004 - operating file failed
104   * @throws { BusinessError } 12000005 - IPC communication failed
105   * @throws { BusinessError } 12000006 - error occurred in crypto engine
106   * @throws { BusinessError } 12000012 - external error
107   * @throws { BusinessError } 12000013 - queried credential does not exist
108   * @throws { BusinessError } 12000014 - memory is insufficient
109   * @throws { BusinessError } 12000015 - call service failed
110   * @syscap SystemCapability.Security.Huks.Core
111   * @atomicservice
112   * @since 11
113   */
114  function generateKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<void>): void;
115
116  /**
117   * Generate Key.
118   *
119   * @param { string } keyAlias - keyAlias indicates the key's name.
120   * @param { HuksOptions } options - options indicates the properties of the key.
121   * @returns { Promise<void> } the promise returned by the function.
122   * @throws { BusinessError } 401 - Parameter error. Possible causes:
123   *                                 1. Mandatory parameters are left unspecified.
124   *                                 2. Incorrect parameter types.
125   *                                 3. Parameter verification failed.
126   * @throws { BusinessError } 801 - api is not supported
127   * @throws { BusinessError } 12000001 - algorithm mode is not supported
128   * @throws { BusinessError } 12000002 - algorithm param is missing
129   * @throws { BusinessError } 12000003 - algorithm param is invalid
130   * @throws { BusinessError } 12000004 - operating file failed
131   * @throws { BusinessError } 12000005 - IPC communication failed
132   * @throws { BusinessError } 12000006 - error occurred in crypto engine
133   * @throws { BusinessError } 12000012 - external error
134   * @throws { BusinessError } 12000013 - queried credential does not exist
135   * @throws { BusinessError } 12000014 - memory is insufficient
136   * @throws { BusinessError } 12000015 - call service failed
137   * @syscap SystemCapability.Security.Huks.Extension
138   * @since 9
139   */
140  /**
141   * Generate Key.
142   *
143   * @param { string } keyAlias - keyAlias indicates the key's name.
144   * @param { HuksOptions } options - options indicates the properties of the key.
145   * @returns { Promise<void> } the promise returned by the function.
146   * @throws { BusinessError } 401 - Parameter error. Possible causes:
147   *                                 1. Mandatory parameters are left unspecified.
148   *                                 2. Incorrect parameter types.
149   *                                 3. Parameter verification failed.
150   * @throws { BusinessError } 801 - api is not supported
151   * @throws { BusinessError } 12000001 - algorithm mode is not supported
152   * @throws { BusinessError } 12000002 - algorithm param is missing
153   * @throws { BusinessError } 12000003 - algorithm param is invalid
154   * @throws { BusinessError } 12000004 - operating file failed
155   * @throws { BusinessError } 12000005 - IPC communication failed
156   * @throws { BusinessError } 12000006 - error occurred in crypto engine
157   * @throws { BusinessError } 12000012 - external error
158   * @throws { BusinessError } 12000013 - queried credential does not exist
159   * @throws { BusinessError } 12000014 - memory is insufficient
160   * @throws { BusinessError } 12000015 - call service failed
161   * @syscap SystemCapability.Security.Huks.Extension
162   * @atomicservice
163   * @since 11
164   */
165  function generateKeyItem(keyAlias: string, options: HuksOptions): Promise<void>;
166
167  /**
168   * Generate Key As User.
169   *
170   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
171   * @param { number } userId - userId indicates the userId of the owner of the key.
172   * @param { string } keyAlias - keyAlias indicates the key's name.
173   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
174   * @returns { Promise<void> } the promise returned by the function.
175   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
176   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
177   * @throws { BusinessError } 202 - not system app
178   * @throws { BusinessError } 401 - Parameter error. Possible causes:
179   *                                 1. Mandatory parameters are left unspecified.
180   *                                 2. Incorrect parameter types.
181   *                                 3. Parameter verification failed.
182   * @throws { BusinessError } 801 - api is not supported
183   * @throws { BusinessError } 12000001 - algorithm mode is not supported
184   * @throws { BusinessError } 12000002 - algorithm param is missing
185   * @throws { BusinessError } 12000003 - algorithm param is invalid
186   * @throws { BusinessError } 12000004 - operating file failed
187   * @throws { BusinessError } 12000005 - IPC communication failed
188   * @throws { BusinessError } 12000006 - error occurred in crypto engine
189   * @throws { BusinessError } 12000012 - external error
190   * @throws { BusinessError } 12000013 - queried credential does not exist
191   * @throws { BusinessError } 12000014 - memory is insufficient
192   * @throws { BusinessError } 12000015 - call service failed
193   * @syscap SystemCapability.Security.Huks.Extension
194   * @systemapi this method can be used only by system applications.
195   * @since 12
196   */
197  function generateKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<void>;
198
199  /**
200   * Delete Key.
201   *
202   * @param { string } keyAlias - keyAlias indicates the key's name.
203   * @param { HuksOptions } options - options indicates the properties of the key.
204   * @param { AsyncCallback<HuksResult> } callback - the callback of deleteKey.
205   * @syscap SystemCapability.Security.Huks.Extension
206   * @since 8
207   * @deprecated since 9
208   * @useinstead ohos.security.huks.deleteKeyItem
209   */
210  function deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
211
212  /**
213   * Delete Key.
214   *
215   * @param { string } keyAlias - keyAlias indicates the key's name.
216   * @param { HuksOptions } options - options indicates the properties of the key.
217   * @returns { Promise<HuksResult> } the promise returned by the function.
218   * @syscap SystemCapability.Security.Huks.Extension
219   * @since 8
220   * @deprecated since 9
221   * @useinstead ohos.security.huks.deleteKeyItem
222   */
223  function deleteKey(keyAlias: string, options: HuksOptions): Promise<HuksResult>;
224
225  /**
226   * Delete Key.
227   *
228   * @param { string } keyAlias - keyAlias indicates the key's name.
229   * @param { HuksOptions } options - options indicates the properties of the key.
230   * @param { AsyncCallback<void> } callback - the callback of deleteKeyItem.
231   * @throws { BusinessError } 401 - Parameter error. Possible causes:
232   *                                 1. Mandatory parameters are left unspecified.
233   *                                 2. Incorrect parameter types.
234   *                                 3. Parameter verification failed.
235   * @throws { BusinessError } 801 - api is not supported
236   * @throws { BusinessError } 12000004 - operating file failed
237   * @throws { BusinessError } 12000005 - IPC communication failed
238   * @throws { BusinessError } 12000011 - queried entity does not exist
239   * @throws { BusinessError } 12000012 - external error
240   * @throws { BusinessError } 12000014 - memory is insufficient
241   * @syscap SystemCapability.Security.Huks.Core
242   * @since 9
243   */
244  /**
245   * Delete Key.
246   *
247   * @param { string } keyAlias - keyAlias indicates the key's name.
248   * @param { HuksOptions } options - options indicates the properties of the key.
249   * @param { AsyncCallback<void> } callback - the callback of deleteKeyItem.
250   * @throws { BusinessError } 401 - Parameter error. Possible causes:
251   *                                 1. Mandatory parameters are left unspecified.
252   *                                 2. Incorrect parameter types.
253   *                                 3. Parameter verification failed.
254   * @throws { BusinessError } 801 - api is not supported
255   * @throws { BusinessError } 12000004 - operating file failed
256   * @throws { BusinessError } 12000005 - IPC communication failed
257   * @throws { BusinessError } 12000011 - queried entity does not exist
258   * @throws { BusinessError } 12000012 - external error
259   * @throws { BusinessError } 12000014 - memory is insufficient
260   * @syscap SystemCapability.Security.Huks.Core
261   * @atomicservice
262   * @since 11
263   */
264  function deleteKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<void>): void;
265
266  /**
267   * Delete Key.
268   *
269   * @param { string } keyAlias - keyAlias indicates the key's name.
270   * @param { HuksOptions } options - options indicates the properties of the key.
271   * @returns { Promise<void> } the promise returned by the function.
272   * @throws { BusinessError } 401 - Parameter error. Possible causes:
273   *                                 1. Mandatory parameters are left unspecified.
274   *                                 2. Incorrect parameter types.
275   *                                 3. Parameter verification failed.
276   * @throws { BusinessError } 801 - api is not supported
277   * @throws { BusinessError } 12000004 - operating file failed
278   * @throws { BusinessError } 12000005 - IPC communication failed
279   * @throws { BusinessError } 12000011 - queried entity does not exist
280   * @throws { BusinessError } 12000012 - external error
281   * @throws { BusinessError } 12000014 - memory is insufficient
282   * @syscap SystemCapability.Security.Huks.Extension
283   * @since 9
284   */
285  /**
286   * Delete Key.
287   *
288   * @param { string } keyAlias - keyAlias indicates the key's name.
289   * @param { HuksOptions } options - options indicates the properties of the key.
290   * @returns { Promise<void> } the promise returned by the function.
291   * @throws { BusinessError } 401 - Parameter error. Possible causes:
292   *                                 1. Mandatory parameters are left unspecified.
293   *                                 2. Incorrect parameter types.
294   *                                 3. Parameter verification failed.
295   * @throws { BusinessError } 801 - api is not supported
296   * @throws { BusinessError } 12000004 - operating file failed
297   * @throws { BusinessError } 12000005 - IPC communication failed
298   * @throws { BusinessError } 12000011 - queried entity does not exist
299   * @throws { BusinessError } 12000012 - external error
300   * @throws { BusinessError } 12000014 - memory is insufficient
301   * @syscap SystemCapability.Security.Huks.Extension
302   * @atomicservice
303   * @since 11
304   */
305  function deleteKeyItem(keyAlias: string, options: HuksOptions): Promise<void>;
306
307  /**
308   * Delete Key As User.
309   *
310   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
311   * @param { number } userId - userId indicates the userId of the owner of the key.
312   * @param { string } keyAlias - keyAlias indicates the key's name.
313   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
314   * @returns { Promise<void> } the promise returned by the function.
315   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
316   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
317   * @throws { BusinessError } 202 - not system app
318   * @throws { BusinessError } 401 - Parameter error. Possible causes:
319   *                                 1. Mandatory parameters are left unspecified.
320   *                                 2. Incorrect parameter types.
321   *                                 3. Parameter verification failed.
322   * @throws { BusinessError } 801 - api is not supported
323   * @throws { BusinessError } 12000004 - operating file failed
324   * @throws { BusinessError } 12000005 - IPC communication failed
325   * @throws { BusinessError } 12000011 - queried entity does not exist
326   * @throws { BusinessError } 12000012 - external error
327   * @throws { BusinessError } 12000014 - memory is insufficient
328   * @syscap SystemCapability.Security.Huks.Extension
329   * @systemapi this method can be used only by system applications.
330   * @since 12
331   */
332  function deleteKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<void>;
333
334  /**
335   * Import Key.
336   *
337   * @param { string } keyAlias - keyAlias indicates the key's name.
338   * @param { HuksOptions } options - options indicates the properties of the key.
339   * @param { AsyncCallback<HuksResult> } callback - the callback of importKey.
340   * @syscap SystemCapability.Security.Huks.Extension
341   * @since 8
342   * @deprecated since 9
343   * @useinstead ohos.security.huks.importKeyItem
344   */
345  function importKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
346
347  /**
348   * Import Key.
349   *
350   * @param { string } keyAlias - keyAlias indicates the key's name.
351   * @param { HuksOptions } options - options indicates the properties of the key.
352   * @returns { Promise<HuksResult> } the promise returned by the function.
353   * @syscap SystemCapability.Security.Huks.Extension
354   * @since 8
355   * @deprecated since 9
356   * @useinstead ohos.security.huks.importKeyItem
357   */
358  function importKey(keyAlias: string, options: HuksOptions): Promise<HuksResult>;
359
360  /**
361   * Import Key.
362   *
363   * @param { string } keyAlias - keyAlias indicates the key's name.
364   * @param { HuksOptions } options - options indicates the properties of the key.
365   * @param { AsyncCallback<void> } callback - the callback of importKeyItem.
366   * @throws { BusinessError } 401 - Parameter error. Possible causes:
367   *                                 1. Mandatory parameters are left unspecified.
368   *                                 2. Incorrect parameter types.
369   *                                 3. Parameter verification failed.
370   * @throws { BusinessError } 801 - api is not supported
371   * @throws { BusinessError } 12000001 - algorithm mode is not supported
372   * @throws { BusinessError } 12000002 - algorithm param is missing
373   * @throws { BusinessError } 12000003 - algorithm param is invalid
374   * @throws { BusinessError } 12000004 - operating file failed
375   * @throws { BusinessError } 12000005 - IPC communication failed
376   * @throws { BusinessError } 12000006 - error occurred in crypto engine
377   * @throws { BusinessError } 12000011 - queried entity does not exist
378   * @throws { BusinessError } 12000012 - external error
379   * @throws { BusinessError } 12000013 - queried credential does not exist
380   * @throws { BusinessError } 12000014 - memory is insufficient
381   * @throws { BusinessError } 12000015 - call service failed
382   * @syscap SystemCapability.Security.Huks.Extension
383   * @since 9
384   */
385  /**
386   * Import Key.
387   *
388   * @param { string } keyAlias - keyAlias indicates the key's name.
389   * @param { HuksOptions } options - options indicates the properties of the key.
390   * @param { AsyncCallback<void> } callback - the callback of importKeyItem.
391   * @throws { BusinessError } 401 - Parameter error. Possible causes:
392   *                                 1. Mandatory parameters are left unspecified.
393   *                                 2. Incorrect parameter types.
394   *                                 3. Parameter verification failed.
395   * @throws { BusinessError } 801 - api is not supported
396   * @throws { BusinessError } 12000001 - algorithm mode is not supported
397   * @throws { BusinessError } 12000002 - algorithm param is missing
398   * @throws { BusinessError } 12000003 - algorithm param is invalid
399   * @throws { BusinessError } 12000004 - operating file failed
400   * @throws { BusinessError } 12000005 - IPC communication failed
401   * @throws { BusinessError } 12000006 - error occurred in crypto engine
402   * @throws { BusinessError } 12000011 - queried entity does not exist
403   * @throws { BusinessError } 12000012 - external error
404   * @throws { BusinessError } 12000013 - queried credential does not exist
405   * @throws { BusinessError } 12000014 - memory is insufficient
406   * @throws { BusinessError } 12000015 - call service failed
407   * @syscap SystemCapability.Security.Huks.Extension
408   * @atomicservice
409   * @since 11
410   */
411  /**
412   * Import Key.
413   *
414   * @param { string } keyAlias - keyAlias indicates the key's name.
415   * @param { HuksOptions } options - options indicates the properties of the key.
416   * @param { AsyncCallback<void> } callback - the callback of importKeyItem.
417   * @throws { BusinessError } 401 - Parameter error. Possible causes:
418   *                                 1. Mandatory parameters are left unspecified.
419   *                                 2. Incorrect parameter types.
420   *                                 3. Parameter verification failed.
421   * @throws { BusinessError } 801 - api is not supported
422   * @throws { BusinessError } 12000001 - algorithm mode is not supported
423   * @throws { BusinessError } 12000002 - algorithm param is missing
424   * @throws { BusinessError } 12000003 - algorithm param is invalid
425   * @throws { BusinessError } 12000004 - operating file failed
426   * @throws { BusinessError } 12000005 - IPC communication failed
427   * @throws { BusinessError } 12000006 - error occurred in crypto engine
428   * @throws { BusinessError } 12000011 - queried entity does not exist
429   * @throws { BusinessError } 12000012 - external error
430   * @throws { BusinessError } 12000013 - queried credential does not exist
431   * @throws { BusinessError } 12000014 - memory is insufficient
432   * @throws { BusinessError } 12000015 - call service failed
433   * @syscap SystemCapability.Security.Huks.Core
434   * @atomicservice
435   * @since 12
436   */
437  function importKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<void>): void;
438
439  /**
440   * Import Key.
441   *
442   * @param { string } keyAlias - keyAlias indicates the key's name.
443   * @param { HuksOptions } options - options indicates the properties of the key.
444   * @returns { Promise<void> } the promise returned by the function.
445   * @throws { BusinessError } 401 - Parameter error. Possible causes:
446   *                                 1. Mandatory parameters are left unspecified.
447   *                                 2. Incorrect parameter types.
448   *                                 3. Parameter verification failed.
449   * @throws { BusinessError } 801 - api is not supported
450   * @throws { BusinessError } 12000001 - algorithm mode is not supported
451   * @throws { BusinessError } 12000002 - algorithm param is missing
452   * @throws { BusinessError } 12000003 - algorithm param is invalid
453   * @throws { BusinessError } 12000004 - operating file failed
454   * @throws { BusinessError } 12000005 - IPC communication failed
455   * @throws { BusinessError } 12000006 - error occurred in crypto engine
456   * @throws { BusinessError } 12000011 - queried entity does not exist
457   * @throws { BusinessError } 12000012 - external error
458   * @throws { BusinessError } 12000013 - queried credential does not exist
459   * @throws { BusinessError } 12000014 - memory is insufficient
460   * @throws { BusinessError } 12000015 - call service failed
461   * @syscap SystemCapability.Security.Huks.Extension
462   * @since 9
463   */
464  /**
465   * Import Key.
466   *
467   * @param { string } keyAlias - keyAlias indicates the key's name.
468   * @param { HuksOptions } options - options indicates the properties of the key.
469   * @returns { Promise<void> } the promise returned by the function.
470   * @throws { BusinessError } 401 - Parameter error. Possible causes:
471   *                                 1. Mandatory parameters are left unspecified.
472   *                                 2. Incorrect parameter types.
473   *                                 3. Parameter verification failed.
474   * @throws { BusinessError } 801 - api is not supported
475   * @throws { BusinessError } 12000001 - algorithm mode is not supported
476   * @throws { BusinessError } 12000002 - algorithm param is missing
477   * @throws { BusinessError } 12000003 - algorithm param is invalid
478   * @throws { BusinessError } 12000004 - operating file failed
479   * @throws { BusinessError } 12000005 - IPC communication failed
480   * @throws { BusinessError } 12000006 - error occurred in crypto engine
481   * @throws { BusinessError } 12000011 - queried entity does not exist
482   * @throws { BusinessError } 12000012 - external error
483   * @throws { BusinessError } 12000013 - queried credential does not exist
484   * @throws { BusinessError } 12000014 - memory is insufficient
485   * @throws { BusinessError } 12000015 - call service failed
486   * @syscap SystemCapability.Security.Huks.Extension
487   * @atomicservice
488   * @since 11
489   */
490  function importKeyItem(keyAlias: string, options: HuksOptions): Promise<void>;
491
492  /**
493   * Import Key As User.
494   *
495   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
496   * @param { number } userId - userId indicates the userId of the owner of the key.
497   * @param { string } keyAlias - keyAlias indicates the key's name.
498   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
499   * @returns { Promise<void> } the promise returned by the function.
500   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
501   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
502   * @throws { BusinessError } 202 - not system app
503   * @throws { BusinessError } 401 - Parameter error. Possible causes:
504   *                                 1. Mandatory parameters are left unspecified.
505   *                                 2. Incorrect parameter types.
506   *                                 3. Parameter verification failed.
507   * @throws { BusinessError } 801 - api is not supported
508   * @throws { BusinessError } 12000001 - algorithm mode is not supported
509   * @throws { BusinessError } 12000002 - algorithm param is missing
510   * @throws { BusinessError } 12000003 - algorithm param is invalid
511   * @throws { BusinessError } 12000004 - operating file failed
512   * @throws { BusinessError } 12000005 - IPC communication failed
513   * @throws { BusinessError } 12000006 - error occurred in crypto engine
514   * @throws { BusinessError } 12000011 - queried entity does not exist
515   * @throws { BusinessError } 12000012 - external error
516   * @throws { BusinessError } 12000013 - queried credential does not exist
517   * @throws { BusinessError } 12000014 - memory is insufficient
518   * @throws { BusinessError } 12000015 - call service failed
519   * @syscap SystemCapability.Security.Huks.Extension
520   * @systemapi this method can be used only by system applications.
521   * @since 12
522   */
523  function importKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<void>;
524
525  /**
526   * Import Wrapped Key.
527   *
528   * @param { string } keyAlias - keyAlias indicates the name of key to be imported.
529   * @param { string } wrappingKeyAlias - wrappingKeyAlias indicates the name of key for wrapping the key to be imported.
530   * @param { HuksOptions } options - options indicates the properties of the key.
531   * @param { AsyncCallback<void> } callback - the callback of importWrappedKeyItem.
532   * @throws { BusinessError } 401 - Parameter error. Possible causes:
533   *                                 1. Mandatory parameters are left unspecified.
534   *                                 2. Incorrect parameter types.
535   *                                 3. Parameter verification failed.
536   * @throws { BusinessError } 801 - api is not supported
537   * @throws { BusinessError } 12000001 - algorithm mode is not supported
538   * @throws { BusinessError } 12000002 - algorithm param is missing
539   * @throws { BusinessError } 12000003 - algorithm param is invalid
540   * @throws { BusinessError } 12000004 - operating file failed
541   * @throws { BusinessError } 12000005 - IPC communication failed
542   * @throws { BusinessError } 12000006 - error occurred in crypto engine
543   * @throws { BusinessError } 12000011 - queried entity does not exist
544   * @throws { BusinessError } 12000012 - external error
545   * @throws { BusinessError } 12000013 - queried credential does not exist
546   * @throws { BusinessError } 12000014 - memory is insufficient
547   * @throws { BusinessError } 12000015 - call service failed
548   * @syscap SystemCapability.Security.Huks.Extension
549   * @since 9
550   */
551  /**
552   * Import Wrapped Key.
553   *
554   * @param { string } keyAlias - keyAlias indicates the name of key to be imported.
555   * @param { string } wrappingKeyAlias - wrappingKeyAlias indicates the name of key for wrapping the key to be imported.
556   * @param { HuksOptions } options - options indicates the properties of the key.
557   * @param { AsyncCallback<void> } callback - the callback of importWrappedKeyItem.
558   * @throws { BusinessError } 401 - Parameter error. Possible causes:
559   *                                 1. Mandatory parameters are left unspecified.
560   *                                 2. Incorrect parameter types.
561   *                                 3. Parameter verification failed.
562   * @throws { BusinessError } 801 - api is not supported
563   * @throws { BusinessError } 12000001 - algorithm mode is not supported
564   * @throws { BusinessError } 12000002 - algorithm param is missing
565   * @throws { BusinessError } 12000003 - algorithm param is invalid
566   * @throws { BusinessError } 12000004 - operating file failed
567   * @throws { BusinessError } 12000005 - IPC communication failed
568   * @throws { BusinessError } 12000006 - error occurred in crypto engine
569   * @throws { BusinessError } 12000011 - queried entity does not exist
570   * @throws { BusinessError } 12000012 - external error
571   * @throws { BusinessError } 12000013 - queried credential does not exist
572   * @throws { BusinessError } 12000014 - memory is insufficient
573   * @throws { BusinessError } 12000015 - call service failed
574   * @syscap SystemCapability.Security.Huks.Core
575   * @atomicservice
576   * @since 12
577   */
578  function importWrappedKeyItem(
579    keyAlias: string,
580    wrappingKeyAlias: string,
581    options: HuksOptions,
582    callback: AsyncCallback<void>
583  ): void;
584
585  /**
586   * Import Wrapped Key As User.
587   *
588   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
589   * @param { number } userId - userId indicates the userId of the owner of the key.
590   * @param { string } keyAlias - keyAlias indicates the name of key to be imported.
591   * @param { string } wrappingKeyAlias - wrappingKeyAlias indicates the name of key for wrapping the key to be imported.
592   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
593   * @returns { Promise<void> } the promise returned by the function.
594   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
595   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
596   * @throws { BusinessError } 202 - not system app
597   * @throws { BusinessError } 401 - Parameter error. Possible causes:
598   *                                 1. Mandatory parameters are left unspecified.
599   *                                 2. Incorrect parameter types.
600   *                                 3. Parameter verification failed.
601   * @throws { BusinessError } 801 - api is not supported
602   * @throws { BusinessError } 12000001 - algorithm mode is not supported
603   * @throws { BusinessError } 12000002 - algorithm param is missing
604   * @throws { BusinessError } 12000003 - algorithm param is invalid
605   * @throws { BusinessError } 12000004 - operating file failed
606   * @throws { BusinessError } 12000005 - IPC communication failed
607   * @throws { BusinessError } 12000006 - error occurred in crypto engine
608   * @throws { BusinessError } 12000011 - queried entity does not exist
609   * @throws { BusinessError } 12000012 - external error
610   * @throws { BusinessError } 12000013 - queried credential does not exist
611   * @throws { BusinessError } 12000014 - memory is insufficient
612   * @throws { BusinessError } 12000015 - call service failed
613   * @syscap SystemCapability.Security.Huks.Extension
614   * @systemapi this method can be used only by system applications.
615   * @since 12
616   */
617  function importWrappedKeyItemAsUser(userId: number, keyAlias: string, wrappingKeyAlias: string, huksOptions: HuksOptions): Promise<void>;
618
619  /**
620   * Import Wrapped Key.
621   *
622   * @param { string } keyAlias - keyAlias indicates the name of key to be imported.
623   * @param { string } wrappingKeyAlias - wrappingKeyAlias indicates the name of key for wrapping the key to be imported.
624   * @param { HuksOptions } options - options indicates the properties of the key.
625   * @returns { Promise<void> } the promise returned by the function.
626   * @throws { BusinessError } 401 - Parameter error. Possible causes:
627   *                                 1. Mandatory parameters are left unspecified.
628   *                                 2. Incorrect parameter types.
629   *                                 3. Parameter verification failed.
630   * @throws { BusinessError } 801 - api is not supported
631   * @throws { BusinessError } 12000001 - algorithm mode is not supported
632   * @throws { BusinessError } 12000002 - algorithm param is missing
633   * @throws { BusinessError } 12000003 - algorithm param is invalid
634   * @throws { BusinessError } 12000004 - operating file failed
635   * @throws { BusinessError } 12000005 - IPC communication failed
636   * @throws { BusinessError } 12000006 - error occurred in crypto engine
637   * @throws { BusinessError } 12000011 - queried entity does not exist
638   * @throws { BusinessError } 12000012 - external error
639   * @throws { BusinessError } 12000013 - queried credential does not exist
640   * @throws { BusinessError } 12000014 - memory is insufficient
641   * @throws { BusinessError } 12000015 - call service failed
642   * @syscap SystemCapability.Security.Huks.Extension
643   * @since 9
644   */
645  /**
646   * Import Wrapped Key.
647   *
648   * @param { string } keyAlias - keyAlias indicates the name of key to be imported.
649   * @param { string } wrappingKeyAlias - wrappingKeyAlias indicates the name of key for wrapping the key to be imported.
650   * @param { HuksOptions } options - options indicates the properties of the key.
651   * @returns { Promise<void> } the promise returned by the function.
652   * @throws { BusinessError } 401 - Parameter error. Possible causes:
653   *                                 1. Mandatory parameters are left unspecified.
654   *                                 2. Incorrect parameter types.
655   *                                 3. Parameter verification failed.
656   * @throws { BusinessError } 801 - api is not supported
657   * @throws { BusinessError } 12000001 - algorithm mode is not supported
658   * @throws { BusinessError } 12000002 - algorithm param is missing
659   * @throws { BusinessError } 12000003 - algorithm param is invalid
660   * @throws { BusinessError } 12000004 - operating file failed
661   * @throws { BusinessError } 12000005 - IPC communication failed
662   * @throws { BusinessError } 12000006 - error occurred in crypto engine
663   * @throws { BusinessError } 12000011 - queried entity does not exist
664   * @throws { BusinessError } 12000012 - external error
665   * @throws { BusinessError } 12000013 - queried credential does not exist
666   * @throws { BusinessError } 12000014 - memory is insufficient
667   * @throws { BusinessError } 12000015 - call service failed
668   * @syscap SystemCapability.Security.Huks.Extension
669   * @atomicservice
670   * @since 12
671   */
672  function importWrappedKeyItem(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions): Promise<void>;
673
674  /**
675   * Export Key.
676   *
677   * @param { string } keyAlias - keyAlias indicates the key's name.
678   * @param { HuksOptions } options - options indicates the properties of the key.
679   * @param { AsyncCallback<HuksResult> } callback - the callback of exportKey.
680   * @syscap SystemCapability.Security.Huks.Extension
681   * @since 8
682   * @deprecated since 9
683   * @useinstead ohos.security.huks.exportKeyItem
684   */
685  function exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
686
687  /**
688   * Export Key.
689   *
690   * @param { string } keyAlias - keyAlias indicates the key's name.
691   * @param { HuksOptions } options - options indicates the properties of the key.
692   * @returns { Promise<HuksResult> } the promise returned by the function.
693   * @syscap SystemCapability.Security.Huks.Extension
694   * @since 8
695   * @deprecated since 9
696   * @useinstead ohos.security.huks.exportKeyItem
697   */
698  function exportKey(keyAlias: string, options: HuksOptions): Promise<HuksResult>;
699
700  /**
701   * Export Key.
702   *
703   * @param { string } keyAlias - keyAlias indicates the key's name.
704   * @param { HuksOptions } options - options indicates the properties of the key.
705   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of exportKeyItem.
706   * @throws { BusinessError } 401 - Parameter error. Possible causes:
707   *                                 1. Mandatory parameters are left unspecified.
708   *                                 2. Incorrect parameter types.
709   *                                 3. Parameter verification failed.
710   * @throws { BusinessError } 801 - api is not supported
711   * @throws { BusinessError } 12000001 - algorithm mode is not supported
712   * @throws { BusinessError } 12000002 - algorithm param is missing
713   * @throws { BusinessError } 12000003 - algorithm param is invalid
714   * @throws { BusinessError } 12000004 - operating file failed
715   * @throws { BusinessError } 12000005 - IPC communication failed
716   * @throws { BusinessError } 12000006 - error occurred in crypto engine
717   * @throws { BusinessError } 12000011 - queried entity does not exist
718   * @throws { BusinessError } 12000012 - external error
719   * @throws { BusinessError } 12000014 - memory is insufficient
720   * @syscap SystemCapability.Security.Huks.Extension
721   * @since 9
722   */
723  /**
724   * Export Key.
725   *
726   * @param { string } keyAlias - keyAlias indicates the key's name.
727   * @param { HuksOptions } options - options indicates the properties of the key.
728   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of exportKeyItem.
729   * @throws { BusinessError } 401 - Parameter error. Possible causes:
730   *                                 1. Mandatory parameters are left unspecified.
731   *                                 2. Incorrect parameter types.
732   *                                 3. Parameter verification failed.
733   * @throws { BusinessError } 801 - api is not supported
734   * @throws { BusinessError } 12000001 - algorithm mode is not supported
735   * @throws { BusinessError } 12000002 - algorithm param is missing
736   * @throws { BusinessError } 12000003 - algorithm param is invalid
737   * @throws { BusinessError } 12000004 - operating file failed
738   * @throws { BusinessError } 12000005 - IPC communication failed
739   * @throws { BusinessError } 12000006 - error occurred in crypto engine
740   * @throws { BusinessError } 12000011 - queried entity does not exist
741   * @throws { BusinessError } 12000012 - external error
742   * @throws { BusinessError } 12000014 - memory is insufficient
743   * @syscap SystemCapability.Security.Huks.Core
744   * @atomicservice
745   * @since 12
746   */
747  function exportKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksReturnResult>): void;
748
749  /**
750   * Export Key As User.
751   *
752   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
753   * @param { number } userId - userId indicates the userId of the owner of the key.
754   * @param { string } keyAlias - keyAlias indicates the key's name.
755   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
756   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
757   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
758   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
759   * @throws { BusinessError } 202 - not system app
760   * @throws { BusinessError } 401 - Parameter error. Possible causes:
761   *                                 1. Mandatory parameters are left unspecified.
762   *                                 2. Incorrect parameter types.
763   *                                 3. Parameter verification failed.
764   * @throws { BusinessError } 801 - api is not supported
765   * @throws { BusinessError } 12000001 - algorithm mode is not supported
766   * @throws { BusinessError } 12000002 - algorithm param is missing
767   * @throws { BusinessError } 12000003 - algorithm param is invalid
768   * @throws { BusinessError } 12000004 - operating file failed
769   * @throws { BusinessError } 12000005 - IPC communication failed
770   * @throws { BusinessError } 12000006 - error occurred in crypto engine
771   * @throws { BusinessError } 12000011 - queried entity does not exist
772   * @throws { BusinessError } 12000012 - external error
773   * @throws { BusinessError } 12000014 - memory is insufficient
774   * @syscap SystemCapability.Security.Huks.Extension
775   * @systemapi this method can be used only by system applications.
776   * @since 12
777   */
778  function exportKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<HuksReturnResult>;
779
780  /**
781   * Export Key.
782   *
783   * @param { string } keyAlias - keyAlias indicates the key's name.
784   * @param { HuksOptions } options - options indicates the properties of the key.
785   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
786   * @throws { BusinessError } 401 - Parameter error. Possible causes:
787   *                                 1. Mandatory parameters are left unspecified.
788   *                                 2. Incorrect parameter types.
789   *                                 3. Parameter verification failed.
790   * @throws { BusinessError } 801 - api is not supported
791   * @throws { BusinessError } 12000001 - algorithm mode is not supported
792   * @throws { BusinessError } 12000002 - algorithm param is missing
793   * @throws { BusinessError } 12000003 - algorithm param is invalid
794   * @throws { BusinessError } 12000004 - operating file failed
795   * @throws { BusinessError } 12000005 - IPC communication failed
796   * @throws { BusinessError } 12000006 - error occurred in crypto engine
797   * @throws { BusinessError } 12000011 - queried entity does not exist
798   * @throws { BusinessError } 12000012 - external error
799   * @throws { BusinessError } 12000014 - memory is insufficient
800   * @syscap SystemCapability.Security.Huks.Extension
801   * @since 9
802   */
803  /**
804   * Export Key.
805   *
806   * @param { string } keyAlias - keyAlias indicates the key's name.
807   * @param { HuksOptions } options - options indicates the properties of the key.
808   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
809   * @throws { BusinessError } 401 - Parameter error. Possible causes:
810   *                                 1. Mandatory parameters are left unspecified.
811   *                                 2. Incorrect parameter types.
812   *                                 3. Parameter verification failed.
813   * @throws { BusinessError } 801 - api is not supported
814   * @throws { BusinessError } 12000001 - algorithm mode is not supported
815   * @throws { BusinessError } 12000002 - algorithm param is missing
816   * @throws { BusinessError } 12000003 - algorithm param is invalid
817   * @throws { BusinessError } 12000004 - operating file failed
818   * @throws { BusinessError } 12000005 - IPC communication failed
819   * @throws { BusinessError } 12000006 - error occurred in crypto engine
820   * @throws { BusinessError } 12000011 - queried entity does not exist
821   * @throws { BusinessError } 12000012 - external error
822   * @throws { BusinessError } 12000014 - memory is insufficient
823   * @syscap SystemCapability.Security.Huks.Extension
824   * @atomicservice
825   * @since 12
826   */
827  function exportKeyItem(keyAlias: string, options: HuksOptions): Promise<HuksReturnResult>;
828
829  /**
830   * Get properties of the key.
831   *
832   * @param { string } keyAlias - keyAlias indicates the key's name.
833   * @param { HuksOptions } options - options indicates the properties of the key.
834   * @param { AsyncCallback<HuksResult> } callback - the callback of getKeyProperties.
835   * @syscap SystemCapability.Security.Huks.Extension
836   * @since 8
837   * @deprecated since 9
838   * @useinstead ohos.security.huks.getKeyItemProperties
839   */
840  function getKeyProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
841
842  /**
843   * Get properties of the key.
844   *
845   * @param { string } keyAlias - keyAlias indicates the key's name.
846   * @param { HuksOptions } options - options indicates the properties of the key.
847   * @returns { Promise<HuksResult> } the promise returned by the function.
848   * @syscap SystemCapability.Security.Huks.Extension
849   * @since 8
850   * @deprecated since 9
851   * @useinstead ohos.security.huks.getKeyItemProperties
852   */
853  function getKeyProperties(keyAlias: string, options: HuksOptions): Promise<HuksResult>;
854
855  /**
856   * Get properties of the key.
857   *
858   * @param { string } keyAlias - keyAlias indicates the key's name.
859   * @param { HuksOptions } options - options indicates the properties of the key.
860   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of getKeyItemProperties.
861   * @throws { BusinessError } 401 - Parameter error. Possible causes:
862   *                                 1. Mandatory parameters are left unspecified.
863   *                                 2. Incorrect parameter types.
864   *                                 3. Parameter verification failed.
865   * @throws { BusinessError } 801 - api is not supported
866   * @throws { BusinessError } 12000001 - algorithm mode is not supported
867   * @throws { BusinessError } 12000002 - algorithm param is missing
868   * @throws { BusinessError } 12000003 - algorithm param is invalid
869   * @throws { BusinessError } 12000004 - operating file failed
870   * @throws { BusinessError } 12000005 - IPC communication failed
871   * @throws { BusinessError } 12000006 - error occurred in crypto engine
872   * @throws { BusinessError } 12000011 - queried entity does not exist
873   * @throws { BusinessError } 12000012 - external error
874   * @throws { BusinessError } 12000014 - memory is insufficient
875   * @syscap SystemCapability.Security.Huks.Extension
876   * @since 9
877   */
878  /**
879   * Get properties of the key.
880   *
881   * @param { string } keyAlias - keyAlias indicates the key's name.
882   * @param { HuksOptions } options - options indicates the properties of the key.
883   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of getKeyItemProperties.
884   * @throws { BusinessError } 401 - Parameter error. Possible causes:
885   *                                 1. Mandatory parameters are left unspecified.
886   *                                 2. Incorrect parameter types.
887   *                                 3. Parameter verification failed.
888   * @throws { BusinessError } 801 - api is not supported
889   * @throws { BusinessError } 12000001 - algorithm mode is not supported
890   * @throws { BusinessError } 12000002 - algorithm param is missing
891   * @throws { BusinessError } 12000003 - algorithm param is invalid
892   * @throws { BusinessError } 12000004 - operating file failed
893   * @throws { BusinessError } 12000005 - IPC communication failed
894   * @throws { BusinessError } 12000006 - error occurred in crypto engine
895   * @throws { BusinessError } 12000011 - queried entity does not exist
896   * @throws { BusinessError } 12000012 - external error
897   * @throws { BusinessError } 12000014 - memory is insufficient
898   * @syscap SystemCapability.Security.Huks.Core
899   * @atomicservice
900   * @since 12
901   */
902  function getKeyItemProperties(
903    keyAlias: string,
904    options: HuksOptions,
905    callback: AsyncCallback<HuksReturnResult>
906  ): void;
907
908  /**
909   * Get properties of the key as user.
910   *
911   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
912   * @param { number } userId - userId indicates the userId of the owner of the key.
913   * @param { string } keyAlias - keyAlias indicates the key's name.
914   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
915   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
916   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
917   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
918   * @throws { BusinessError } 202 - not system app
919   * @throws { BusinessError } 401 - Parameter error. Possible causes:
920   *                                 1. Mandatory parameters are left unspecified.
921   *                                 2. Incorrect parameter types.
922   *                                 3. Parameter verification failed.
923   * @throws { BusinessError } 801 - api is not supported
924   * @throws { BusinessError } 12000001 - algorithm mode is not supported
925   * @throws { BusinessError } 12000002 - algorithm param is missing
926   * @throws { BusinessError } 12000003 - algorithm param is invalid
927   * @throws { BusinessError } 12000004 - operating file failed
928   * @throws { BusinessError } 12000005 - IPC communication failed
929   * @throws { BusinessError } 12000006 - error occurred in crypto engine
930   * @throws { BusinessError } 12000011 - queried entity does not exist
931   * @throws { BusinessError } 12000012 - external error
932   * @throws { BusinessError } 12000014 - memory is insufficient
933   * @syscap SystemCapability.Security.Huks.Extension
934   * @systemapi this method can be used only by system applications.
935   * @since 12
936   */
937  function getKeyItemPropertiesAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<HuksReturnResult>;
938
939  /**
940   * Get properties of the key.
941   *
942   * @param { string } keyAlias - keyAlias indicates the key's name.
943   * @param { HuksOptions } options - options indicates the properties of the key.
944   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
945   * @throws { BusinessError } 401 - Parameter error. Possible causes:
946   *                                 1. Mandatory parameters are left unspecified.
947   *                                 2. Incorrect parameter types.
948   *                                 3. Parameter verification failed.
949   * @throws { BusinessError } 801 - api is not supported
950   * @throws { BusinessError } 12000001 - algorithm mode is not supported
951   * @throws { BusinessError } 12000002 - algorithm param is missing
952   * @throws { BusinessError } 12000003 - algorithm param is invalid
953   * @throws { BusinessError } 12000004 - operating file failed
954   * @throws { BusinessError } 12000005 - IPC communication failed
955   * @throws { BusinessError } 12000006 - error occurred in crypto engine
956   * @throws { BusinessError } 12000011 - queried entity does not exist
957   * @throws { BusinessError } 12000012 - external error
958   * @throws { BusinessError } 12000014 - memory is insufficient
959   * @syscap SystemCapability.Security.Huks.Extension
960   * @since 9
961   */
962  /**
963   * Get properties of the key.
964   *
965   * @param { string } keyAlias - keyAlias indicates the key's name.
966   * @param { HuksOptions } options - options indicates the properties of the key.
967   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
968   * @throws { BusinessError } 401 - Parameter error. Possible causes:
969   *                                 1. Mandatory parameters are left unspecified.
970   *                                 2. Incorrect parameter types.
971   *                                 3. Parameter verification failed.
972   * @throws { BusinessError } 801 - api is not supported
973   * @throws { BusinessError } 12000001 - algorithm mode is not supported
974   * @throws { BusinessError } 12000002 - algorithm param is missing
975   * @throws { BusinessError } 12000003 - algorithm param is invalid
976   * @throws { BusinessError } 12000004 - operating file failed
977   * @throws { BusinessError } 12000005 - IPC communication failed
978   * @throws { BusinessError } 12000006 - error occurred in crypto engine
979   * @throws { BusinessError } 12000011 - queried entity does not exist
980   * @throws { BusinessError } 12000012 - external error
981   * @throws { BusinessError } 12000014 - memory is insufficient
982   * @syscap SystemCapability.Security.Huks.Extension
983   * @atomicservice
984   * @since 12
985   */
986  function getKeyItemProperties(keyAlias: string, options: HuksOptions): Promise<HuksReturnResult>;
987
988  /**
989   * Check whether the key exists.
990   *
991   * @param { string } keyAlias - keyAlias indicates the key's name.
992   * @param { HuksOptions } options - options indicates the properties of the key.
993   * @param { AsyncCallback<boolean> } callback - the callback of isKeyExist.
994   * @syscap SystemCapability.Security.Huks.Extension
995   * @since 8
996   * @deprecated since 9
997   * @useinstead ohos.security.huks.isKeyItemExist
998   */
999  function isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback<boolean>): void;
1000
1001  /**
1002   * Check whether the key exists.
1003   *
1004   * @param { string } keyAlias - keyAlias indicates the key's name.
1005   * @param { HuksOptions } options - options indicates the properties of the key.
1006   * @returns { Promise<boolean> } the promise returned by the function.
1007   * @syscap SystemCapability.Security.Huks.Extension
1008   * @since 8
1009   * @deprecated since 9
1010   * @useinstead ohos.security.huks.isKeyItemExist
1011   */
1012  function isKeyExist(keyAlias: string, options: HuksOptions): Promise<boolean>;
1013
1014  /**
1015   * Check whether the key exists.
1016   *
1017   * @param { string } keyAlias - keyAlias indicates the key's name.
1018   * @param { HuksOptions } options - options indicates the properties of the key.
1019   * @param { AsyncCallback<boolean> } callback - the callback of isKeyItemExist.
1020   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1021   *                                 1. Mandatory parameters are left unspecified.
1022   *                                 2. Incorrect parameter types.
1023   *                                 3. Parameter verification failed.
1024   * @throws { BusinessError } 801 - api is not supported
1025   * @throws { BusinessError } 12000002 - algorithm param is missing
1026   * @throws { BusinessError } 12000003 - algorithm param is invalid
1027   * @throws { BusinessError } 12000004 - operating file failed
1028   * @throws { BusinessError } 12000005 - IPC communication failed
1029   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1030   * @throws { BusinessError } 12000011 - queried entity does not exist
1031   * @throws { BusinessError } 12000012 - external error
1032   * @throws { BusinessError } 12000014 - memory is insufficient
1033   * @syscap SystemCapability.Security.Huks.Core
1034   * @since 9
1035   */
1036  function isKeyItemExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback<boolean>): void;
1037
1038  /**
1039   * Check whether the key exists.
1040   *
1041   * @param { string } keyAlias - keyAlias indicates the key's name.
1042   * @param { HuksOptions } options - options indicates the properties of the key.
1043   * @returns { Promise<boolean> } the promise returned by the function.
1044   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1045   *                                 1. Mandatory parameters are left unspecified.
1046   *                                 2. Incorrect parameter types.
1047   *                                 3. Parameter verification failed.
1048   * @throws { BusinessError } 801 - api is not supported
1049   * @throws { BusinessError } 12000002 - algorithm param is missing
1050   * @throws { BusinessError } 12000003 - algorithm param is invalid
1051   * @throws { BusinessError } 12000004 - operating file failed
1052   * @throws { BusinessError } 12000005 - IPC communication failed
1053   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1054   * @throws { BusinessError } 12000011 - queried entity does not exist
1055   * @throws { BusinessError } 12000012 - external error
1056   * @throws { BusinessError } 12000014 - memory is insufficient
1057   * @syscap SystemCapability.Security.Huks.Extension
1058   * @since 9
1059   */
1060  function isKeyItemExist(keyAlias: string, options: HuksOptions): Promise<boolean>;
1061
1062  /**
1063   * Check whether the key exists.
1064   *
1065   * @param { string } keyAlias - keyAlias indicates the key's name.
1066   * @param { HuksOptions } options - options indicates the properties of the key.
1067   * @param { AsyncCallback<boolean> } callback - the callback of isKeyItemExist.
1068   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1069   *                                 1. Mandatory parameters are left unspecified.
1070   *                                 2. Incorrect parameter types.
1071   *                                 3. Parameter verification failed.
1072   * @throws { BusinessError } 801 - api is not supported
1073   * @throws { BusinessError } 12000002 - algorithm param is missing
1074   * @throws { BusinessError } 12000003 - algorithm param is invalid
1075   * @throws { BusinessError } 12000004 - operating file failed
1076   * @throws { BusinessError } 12000005 - IPC communication failed
1077   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1078   * @throws { BusinessError } 12000012 - external error
1079   * @throws { BusinessError } 12000014 - memory is insufficient
1080   * @syscap SystemCapability.Security.Huks.Core
1081   * @atomicservice
1082   * @since 11
1083   */
1084  function hasKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<boolean>): void;
1085
1086  /**
1087   * Check whether the key exists as user.
1088   *
1089   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
1090   * @param { number } userId - userId indicates the userId of the owner of the key.
1091   * @param { string } keyAlias - keyAlias indicates the key's name.
1092   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
1093   * @returns { Promise<boolean> } the promise returned by the function.
1094   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
1095   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
1096   * @throws { BusinessError } 202 - not system app
1097   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1098   *                                 1. Mandatory parameters are left unspecified.
1099   *                                 2. Incorrect parameter types.
1100   *                                 3. Parameter verification failed.
1101   * @throws { BusinessError } 801 - api is not supported
1102   * @throws { BusinessError } 12000002 - algorithm param is missing
1103   * @throws { BusinessError } 12000003 - algorithm param is invalid
1104   * @throws { BusinessError } 12000004 - operating file failed
1105   * @throws { BusinessError } 12000005 - IPC communication failed
1106   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1107   * @throws { BusinessError } 12000012 - external error
1108   * @throws { BusinessError } 12000014 - memory is insufficient
1109   * @syscap SystemCapability.Security.Huks.Extension
1110   * @systemapi this method can be used only by system applications.
1111   * @since 12
1112   */
1113  function hasKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<boolean>;
1114
1115  /**
1116   * Check whether the key exists.
1117   *
1118   * @param { string } keyAlias - keyAlias indicates the key's name.
1119   * @param { HuksOptions } options - options indicates the properties of the key.
1120   * @returns { Promise<boolean> } the promise returned by the function.
1121   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1122   *                                 1. Mandatory parameters are left unspecified.
1123   *                                 2. Incorrect parameter types.
1124   *                                 3. Parameter verification failed.
1125   * @throws { BusinessError } 801 - api is not supported
1126   * @throws { BusinessError } 12000002 - algorithm param is missing
1127   * @throws { BusinessError } 12000003 - algorithm param is invalid
1128   * @throws { BusinessError } 12000004 - operating file failed
1129   * @throws { BusinessError } 12000005 - IPC communication failed
1130   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1131   * @throws { BusinessError } 12000012 - external error
1132   * @throws { BusinessError } 12000014 - memory is insufficient
1133   * @syscap SystemCapability.Security.Huks.Extension
1134   * @atomicservice
1135   * @since 11
1136   */
1137  function hasKeyItem(keyAlias: string, options: HuksOptions): Promise<boolean>;
1138
1139  /**
1140   * Init Operation.
1141   *
1142   * @param { string } keyAlias - keyAlias indicates the key's name.
1143   * @param { HuksOptions } options - options indicates the properties of the key.
1144   * @param { AsyncCallback<HuksHandle> } callback - the callback of init, include the handle.
1145   * @syscap SystemCapability.Security.Huks.Extension
1146   * @since 8
1147   * @deprecated since 9
1148   * @useinstead ohos.security.huks.initSession
1149   */
1150  function init(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksHandle>): void;
1151
1152  /**
1153   * Init Operation.
1154   *
1155   * @param { string } keyAlias - keyAlias indicates the key's name.
1156   * @param { HuksOptions } options - options indicates the properties of the key.
1157   * @returns { Promise<HuksHandle> } the promise returned by the function, include the handle.
1158   * @syscap SystemCapability.Security.Huks.Extension
1159   * @since 8
1160   * @deprecated since 9
1161   * @useinstead ohos.security.huks.initSession
1162   */
1163  function init(keyAlias: string, options: HuksOptions): Promise<HuksHandle>;
1164
1165  /**
1166   * Init Operation.
1167   *
1168   * @param { string } keyAlias - keyAlias indicates the key's name.
1169   * @param { HuksOptions } options - options indicates the properties of the key.
1170   * @param { AsyncCallback<HuksSessionHandle> } callback - the callback of initSession.
1171   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1172   *                                 1. Mandatory parameters are left unspecified.
1173   *                                 2. Incorrect parameter types.
1174   *                                 3. Parameter verification failed.
1175   * @throws { BusinessError } 801 - api is not supported
1176   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1177   * @throws { BusinessError } 12000002 - algorithm param is missing
1178   * @throws { BusinessError } 12000003 - algorithm param is invalid
1179   * @throws { BusinessError } 12000004 - operating file failed
1180   * @throws { BusinessError } 12000005 - IPC communication failed
1181   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1182   * @throws { BusinessError } 12000010 - the number of sessions has reached limit
1183   * @throws { BusinessError } 12000011 - queried entity does not exist
1184   * @throws { BusinessError } 12000012 - external error
1185   * @throws { BusinessError } 12000014 - memory is insufficient
1186   * @syscap SystemCapability.Security.Huks.Core
1187   * @since 9
1188   */
1189  /**
1190   * Init Operation.
1191   *
1192   * @param { string } keyAlias - keyAlias indicates the key's name.
1193   * @param { HuksOptions } options - options indicates the properties of the key.
1194   * @param { AsyncCallback<HuksSessionHandle> } callback - the callback of initSession.
1195   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1196   *                                 1. Mandatory parameters are left unspecified.
1197   *                                 2. Incorrect parameter types.
1198   *                                 3. Parameter verification failed.
1199   * @throws { BusinessError } 801 - api is not supported
1200   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1201   * @throws { BusinessError } 12000002 - algorithm param is missing
1202   * @throws { BusinessError } 12000003 - algorithm param is invalid
1203   * @throws { BusinessError } 12000004 - operating file failed
1204   * @throws { BusinessError } 12000005 - IPC communication failed
1205   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1206   * @throws { BusinessError } 12000010 - the number of sessions has reached limit
1207   * @throws { BusinessError } 12000011 - queried entity does not exist
1208   * @throws { BusinessError } 12000012 - external error
1209   * @throws { BusinessError } 12000014 - memory is insufficient
1210   * @syscap SystemCapability.Security.Huks.Core
1211   * @atomicservice
1212   * @since 11
1213   */
1214  function initSession(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksSessionHandle>): void;
1215
1216  /**
1217   * Init Operation.
1218   *
1219   * @param { string } keyAlias - keyAlias indicates the key's name.
1220   * @param { HuksOptions } options - options indicates the properties of the key.
1221   * @returns { Promise<HuksSessionHandle> } the promise returned by the function.
1222   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1223   *                                 1. Mandatory parameters are left unspecified.
1224   *                                 2. Incorrect parameter types.
1225   *                                 3. Parameter verification failed.
1226   * @throws { BusinessError } 801 - api is not supported
1227   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1228   * @throws { BusinessError } 12000002 - algorithm param is missing
1229   * @throws { BusinessError } 12000003 - algorithm param is invalid
1230   * @throws { BusinessError } 12000004 - operating file failed
1231   * @throws { BusinessError } 12000005 - IPC communication failed
1232   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1233   * @throws { BusinessError } 12000010 - the number of sessions has reached limit
1234   * @throws { BusinessError } 12000011 - queried entity does not exist
1235   * @throws { BusinessError } 12000012 - external error
1236   * @throws { BusinessError } 12000014 - memory is insufficient
1237   * @syscap SystemCapability.Security.Huks.Extension
1238   * @since 9
1239   */
1240  /**
1241   * Init Operation.
1242   *
1243   * @param { string } keyAlias - keyAlias indicates the key's name.
1244   * @param { HuksOptions } options - options indicates the properties of the key.
1245   * @returns { Promise<HuksSessionHandle> } the promise returned by the function.
1246   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1247   *                                 1. Mandatory parameters are left unspecified.
1248   *                                 2. Incorrect parameter types.
1249   *                                 3. Parameter verification failed.
1250   * @throws { BusinessError } 801 - api is not supported
1251   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1252   * @throws { BusinessError } 12000002 - algorithm param is missing
1253   * @throws { BusinessError } 12000003 - algorithm param is invalid
1254   * @throws { BusinessError } 12000004 - operating file failed
1255   * @throws { BusinessError } 12000005 - IPC communication failed
1256   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1257   * @throws { BusinessError } 12000010 - the number of sessions has reached limit
1258   * @throws { BusinessError } 12000011 - queried entity does not exist
1259   * @throws { BusinessError } 12000012 - external error
1260   * @throws { BusinessError } 12000014 - memory is insufficient
1261   * @syscap SystemCapability.Security.Huks.Extension
1262   * @atomicservice
1263   * @since 11
1264   */
1265  function initSession(keyAlias: string, options: HuksOptions): Promise<HuksSessionHandle>;
1266
1267  /**
1268   * Init Operation As User.
1269   *
1270   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
1271   * @param { number } userId - userId indicates the userId of the owner of the key.
1272   * @param { string } keyAlias - keyAlias indicates the key's name.
1273   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key.
1274   * @returns { Promise<HuksSessionHandle> } the promise returned by the function.
1275   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
1276   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
1277   * @throws { BusinessError } 202 - not system app
1278   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1279   *                                 1. Mandatory parameters are left unspecified.
1280   *                                 2. Incorrect parameter types.
1281   *                                 3. Parameter verification failed.
1282   * @throws { BusinessError } 801 - api is not supported
1283   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1284   * @throws { BusinessError } 12000002 - algorithm param is missing
1285   * @throws { BusinessError } 12000003 - algorithm param is invalid
1286   * @throws { BusinessError } 12000004 - operating file failed
1287   * @throws { BusinessError } 12000005 - IPC communication failed
1288   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1289   * @throws { BusinessError } 12000010 - the number of sessions has reached limit
1290   * @throws { BusinessError } 12000011 - queried entity does not exist
1291   * @throws { BusinessError } 12000012 - external error
1292   * @throws { BusinessError } 12000014 - memory is insufficient
1293   * @syscap SystemCapability.Security.Huks.Extension
1294   * @systemapi this method can be used only by system applications.
1295   * @since 12
1296   */
1297  function initSessionAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<HuksSessionHandle>;
1298
1299  /**
1300   * Update Operation.
1301   *
1302   * @param { number } handle - indicates the handle of the init operation.
1303   * @param { Uint8Array } token - token indicates the value of token.
1304   * @param { HuksOptions } options - options indicates the properties of the update operation.
1305   * @param { AsyncCallback<HuksResult> } callback - the callback of update.
1306   * @syscap SystemCapability.Security.Huks.Extension
1307   * @since 8
1308   * @deprecated since 9
1309   * @useinstead ohos.security.huks.updateSession
1310   */
1311  function update(handle: number, token?: Uint8Array, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
1312
1313  /**
1314   * Update Operation.
1315   *
1316   * @param { number } handle - indicates the handle of the init operation.
1317   * @param { Uint8Array } token - indicates the value of token.
1318   * @param { HuksOptions } options - options indicates the properties of the update operation.
1319   * @returns { Promise<HuksResult> } the promise returned by the function.
1320   * @syscap SystemCapability.Security.Huks.Extension
1321   * @since 8
1322   * @deprecated since 9
1323   * @useinstead ohos.security.huks.updateSession
1324   */
1325  function update(handle: number, token?: Uint8Array, options: HuksOptions): Promise<HuksResult>;
1326
1327  /**
1328   * Update Operation.
1329   *
1330   * @param { number } handle - indicates the handle of the init operation.
1331   * @param { HuksOptions } options - options indicates the properties of the update operation.
1332   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of updateSession.
1333   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1334   *                                 1. Mandatory parameters are left unspecified.
1335   *                                 2. Incorrect parameter types.
1336   *                                 3. Parameter verification failed.
1337   * @throws { BusinessError } 801 - api is not supported
1338   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1339   * @throws { BusinessError } 12000002 - algorithm param is missing
1340   * @throws { BusinessError } 12000003 - algorithm param is invalid
1341   * @throws { BusinessError } 12000004 - operating file failed
1342   * @throws { BusinessError } 12000005 - IPC communication failed
1343   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1344   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1345   * @throws { BusinessError } 12000008 - verify auth token failed
1346   * @throws { BusinessError } 12000009 - auth token is already timeout
1347   * @throws { BusinessError } 12000011 - queried entity does not exist
1348   * @throws { BusinessError } 12000012 - external error
1349   * @throws { BusinessError } 12000014 - memory is insufficient
1350   * @syscap SystemCapability.Security.Huks.Core
1351   * @since 9
1352   */
1353  /**
1354   * Update Operation.
1355   *
1356   * @param { number } handle - indicates the handle of the init operation.
1357   * @param { HuksOptions } options - options indicates the properties of the update operation.
1358   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of updateSession.
1359   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1360   *                                 1. Mandatory parameters are left unspecified.
1361   *                                 2. Incorrect parameter types.
1362   *                                 3. Parameter verification failed.
1363   * @throws { BusinessError } 801 - api is not supported
1364   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1365   * @throws { BusinessError } 12000002 - algorithm param is missing
1366   * @throws { BusinessError } 12000003 - algorithm param is invalid
1367   * @throws { BusinessError } 12000004 - operating file failed
1368   * @throws { BusinessError } 12000005 - IPC communication failed
1369   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1370   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1371   * @throws { BusinessError } 12000008 - verify auth token failed
1372   * @throws { BusinessError } 12000009 - auth token is already timeout
1373   * @throws { BusinessError } 12000011 - queried entity does not exist
1374   * @throws { BusinessError } 12000012 - external error
1375   * @throws { BusinessError } 12000014 - memory is insufficient
1376   * @syscap SystemCapability.Security.Huks.Core
1377   * @atomicservice
1378   * @since 11
1379   */
1380  function updateSession(handle: number, options: HuksOptions, callback: AsyncCallback<HuksReturnResult>): void;
1381
1382  /**
1383   * Update Operation.
1384   *
1385   * @param { number } handle - indicates the handle of the init operation.
1386   * @param { HuksOptions } options - options indicates the properties of the update operation.
1387   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1388   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of updateSession.
1389   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1390   *                                 1. Mandatory parameters are left unspecified.
1391   *                                 2. Incorrect parameter types.
1392   *                                 3. Parameter verification failed.
1393   * @throws { BusinessError } 801 - api is not supported
1394   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1395   * @throws { BusinessError } 12000002 - algorithm param is missing
1396   * @throws { BusinessError } 12000003 - algorithm param is invalid
1397   * @throws { BusinessError } 12000004 - operating file failed
1398   * @throws { BusinessError } 12000005 - IPC communication failed
1399   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1400   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1401   * @throws { BusinessError } 12000008 - verify auth token failed
1402   * @throws { BusinessError } 12000009 - auth token is already timeout
1403   * @throws { BusinessError } 12000011 - queried entity does not exist
1404   * @throws { BusinessError } 12000012 - external error
1405   * @throws { BusinessError } 12000014 - memory is insufficient
1406   * @syscap SystemCapability.Security.Huks.Extension
1407   * @since 9
1408   */
1409  /**
1410   * Update Operation.
1411   *
1412   * @param { number } handle - indicates the handle of the init operation.
1413   * @param { HuksOptions } options - options indicates the properties of the update operation.
1414   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1415   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of updateSession.
1416   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1417   *                                 1. Mandatory parameters are left unspecified.
1418   *                                 2. Incorrect parameter types.
1419   *                                 3. Parameter verification failed.
1420   * @throws { BusinessError } 801 - api is not supported
1421   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1422   * @throws { BusinessError } 12000002 - algorithm param is missing
1423   * @throws { BusinessError } 12000003 - algorithm param is invalid
1424   * @throws { BusinessError } 12000004 - operating file failed
1425   * @throws { BusinessError } 12000005 - IPC communication failed
1426   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1427   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1428   * @throws { BusinessError } 12000008 - verify auth token failed
1429   * @throws { BusinessError } 12000009 - auth token is already timeout
1430   * @throws { BusinessError } 12000011 - queried entity does not exist
1431   * @throws { BusinessError } 12000012 - external error
1432   * @throws { BusinessError } 12000014 - memory is insufficient
1433   * @syscap SystemCapability.Security.Huks.Extension
1434   * @atomicservice
1435   * @since 12
1436   */
1437  function updateSession(
1438    handle: number,
1439    options: HuksOptions,
1440    token: Uint8Array,
1441    callback: AsyncCallback<HuksReturnResult>
1442  ): void;
1443
1444  /**
1445   * Update Operation.
1446   *
1447   * @param { number } handle - indicates the handle of the init operation.
1448   * @param { HuksOptions } options - options indicates the properties of the update operation.
1449   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1450   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1451   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1452   *                                 1. Mandatory parameters are left unspecified.
1453   *                                 2. Incorrect parameter types.
1454   *                                 3. Parameter verification failed.
1455   * @throws { BusinessError } 801 - api is not supported
1456   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1457   * @throws { BusinessError } 12000002 - algorithm param is missing
1458   * @throws { BusinessError } 12000003 - algorithm param is invalid
1459   * @throws { BusinessError } 12000004 - operating file failed
1460   * @throws { BusinessError } 12000005 - IPC communication failed
1461   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1462   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1463   * @throws { BusinessError } 12000008 - verify auth token failed
1464   * @throws { BusinessError } 12000009 - auth token is already timeout
1465   * @throws { BusinessError } 12000011 - queried entity does not exist
1466   * @throws { BusinessError } 12000012 - external error
1467   * @throws { BusinessError } 12000014 - memory is insufficient
1468   * @syscap SystemCapability.Security.Huks.Extension
1469   * @since 9
1470   */
1471  /**
1472   * Update Operation.
1473   *
1474   * @param { number } handle - indicates the handle of the init operation.
1475   * @param { HuksOptions } options - options indicates the properties of the update operation.
1476   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1477   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1478   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1479   *                                 1. Mandatory parameters are left unspecified.
1480   *                                 2. Incorrect parameter types.
1481   *                                 3. Parameter verification failed.
1482   * @throws { BusinessError } 801 - api is not supported
1483   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1484   * @throws { BusinessError } 12000002 - algorithm param is missing
1485   * @throws { BusinessError } 12000003 - algorithm param is invalid
1486   * @throws { BusinessError } 12000004 - operating file failed
1487   * @throws { BusinessError } 12000005 - IPC communication failed
1488   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1489   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1490   * @throws { BusinessError } 12000008 - verify auth token failed
1491   * @throws { BusinessError } 12000009 - auth token is already timeout
1492   * @throws { BusinessError } 12000011 - queried entity does not exist
1493   * @throws { BusinessError } 12000012 - external error
1494   * @throws { BusinessError } 12000014 - memory is insufficient
1495   * @syscap SystemCapability.Security.Huks.Extension
1496   * @atomicservice
1497   * @since 11
1498   */
1499  function updateSession(handle: number, options: HuksOptions, token?: Uint8Array): Promise<HuksReturnResult>;
1500
1501  /**
1502   * Finish Operation.
1503   *
1504   * @param { number } handle - indicates the handle of the init operation.
1505   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1506   * @param { AsyncCallback<HuksResult> } callback - the callback of finish.
1507   * @syscap SystemCapability.Security.Huks.Extension
1508   * @since 8
1509   * @deprecated since 9
1510   * @useinstead ohos.security.huks.finishSession
1511   */
1512  function finish(handle: number, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
1513
1514  /**
1515   * Finish Operation.
1516   *
1517   * @param { number } handle - indicates the handle of the init operation.
1518   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1519   * @returns { Promise<HuksResult> } the promise returned by the function.
1520   * @syscap SystemCapability.Security.Huks.Extension
1521   * @since 8
1522   * @deprecated since 9
1523   * @useinstead ohos.security.huks.finishSession
1524   */
1525  function finish(handle: number, options: HuksOptions): Promise<HuksResult>;
1526
1527  /**
1528   * Finish Operation.
1529   *
1530   * @param { number } handle - indicates the handle of the init operation.
1531   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1532   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of finishSession.
1533   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1534   *                                 1. Mandatory parameters are left unspecified.
1535   *                                 2. Incorrect parameter types.
1536   *                                 3. Parameter verification failed.
1537   * @throws { BusinessError } 801 - api is not supported
1538   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1539   * @throws { BusinessError } 12000002 - algorithm param is missing
1540   * @throws { BusinessError } 12000003 - algorithm param is invalid
1541   * @throws { BusinessError } 12000004 - operating file failed
1542   * @throws { BusinessError } 12000005 - IPC communication failed
1543   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1544   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1545   * @throws { BusinessError } 12000008 - verify auth token failed
1546   * @throws { BusinessError } 12000009 - auth token is already timeout
1547   * @throws { BusinessError } 12000011 - queried entity does not exist
1548   * @throws { BusinessError } 12000012 - external error
1549   * @throws { BusinessError } 12000014 - memory is insufficient
1550   * @syscap SystemCapability.Security.Huks.Core
1551   * @since 9
1552   */
1553  /**
1554   * Finish Operation.
1555   *
1556   * @param { number } handle - indicates the handle of the init operation.
1557   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1558   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of finishSession.
1559   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1560   *                                 1. Mandatory parameters are left unspecified.
1561   *                                 2. Incorrect parameter types.
1562   *                                 3. Parameter verification failed.
1563   * @throws { BusinessError } 801 - api is not supported
1564   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1565   * @throws { BusinessError } 12000002 - algorithm param is missing
1566   * @throws { BusinessError } 12000003 - algorithm param is invalid
1567   * @throws { BusinessError } 12000004 - operating file failed
1568   * @throws { BusinessError } 12000005 - IPC communication failed
1569   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1570   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1571   * @throws { BusinessError } 12000008 - verify auth token failed
1572   * @throws { BusinessError } 12000009 - auth token is already timeout
1573   * @throws { BusinessError } 12000011 - queried entity does not exist
1574   * @throws { BusinessError } 12000012 - external error
1575   * @throws { BusinessError } 12000014 - memory is insufficient
1576   * @syscap SystemCapability.Security.Huks.Core
1577   * @atomicservice
1578   * @since 11
1579   */
1580  function finishSession(handle: number, options: HuksOptions, callback: AsyncCallback<HuksReturnResult>): void;
1581
1582  /**
1583   * Finish Operation.
1584   *
1585   * @param { number } handle - indicates the handle of the init operation.
1586   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1587   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1588   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of finishSession.
1589   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1590   *                                 1. Mandatory parameters are left unspecified.
1591   *                                 2. Incorrect parameter types.
1592   *                                 3. Parameter verification failed.
1593   * @throws { BusinessError } 801 - api is not supported
1594   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1595   * @throws { BusinessError } 12000002 - algorithm param is missing
1596   * @throws { BusinessError } 12000003 - algorithm param is invalid
1597   * @throws { BusinessError } 12000004 - operating file failed
1598   * @throws { BusinessError } 12000005 - IPC communication failed
1599   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1600   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1601   * @throws { BusinessError } 12000008 - verify auth token failed
1602   * @throws { BusinessError } 12000009 - auth token is already timeout
1603   * @throws { BusinessError } 12000011 - queried entity does not exist
1604   * @throws { BusinessError } 12000012 - external error
1605   * @throws { BusinessError } 12000014 - memory is insufficient
1606   * @syscap SystemCapability.Security.Huks.Extension
1607   * @since 9
1608   */
1609  /**
1610   * Finish Operation.
1611   *
1612   * @param { number } handle - indicates the handle of the init operation.
1613   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1614   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1615   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of finishSession.
1616   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1617   *                                 1. Mandatory parameters are left unspecified.
1618   *                                 2. Incorrect parameter types.
1619   *                                 3. Parameter verification failed.
1620   * @throws { BusinessError } 801 - api is not supported
1621   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1622   * @throws { BusinessError } 12000002 - algorithm param is missing
1623   * @throws { BusinessError } 12000003 - algorithm param is invalid
1624   * @throws { BusinessError } 12000004 - operating file failed
1625   * @throws { BusinessError } 12000005 - IPC communication failed
1626   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1627   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1628   * @throws { BusinessError } 12000008 - verify auth token failed
1629   * @throws { BusinessError } 12000009 - auth token is already timeout
1630   * @throws { BusinessError } 12000011 - queried entity does not exist
1631   * @throws { BusinessError } 12000012 - external error
1632   * @throws { BusinessError } 12000014 - memory is insufficient
1633   * @syscap SystemCapability.Security.Huks.Extension
1634   * @atomicservice
1635   * @since 12
1636   */
1637  function finishSession(
1638    handle: number,
1639    options: HuksOptions,
1640    token: Uint8Array,
1641    callback: AsyncCallback<HuksReturnResult>
1642  ): void;
1643
1644  /**
1645   * Finish Operation.
1646   *
1647   * @param { number } handle - indicates the handle of the init operation.
1648   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1649   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1650   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1651   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1652   *                                 1. Mandatory parameters are left unspecified.
1653   *                                 2. Incorrect parameter types.
1654   *                                 3. Parameter verification failed.
1655   * @throws { BusinessError } 801 - api is not supported
1656   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1657   * @throws { BusinessError } 12000002 - algorithm param is missing
1658   * @throws { BusinessError } 12000003 - algorithm param is invalid
1659   * @throws { BusinessError } 12000004 - operating file failed
1660   * @throws { BusinessError } 12000005 - IPC communication failed
1661   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1662   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1663   * @throws { BusinessError } 12000008 - verify auth token failed
1664   * @throws { BusinessError } 12000009 - auth token is already timeout
1665   * @throws { BusinessError } 12000011 - queried entity does not exist
1666   * @throws { BusinessError } 12000012 - external error
1667   * @throws { BusinessError } 12000014 - memory is insufficient
1668   * @syscap SystemCapability.Security.Huks.Extension
1669   * @since 9
1670   */
1671  /**
1672   * Finish Operation.
1673   *
1674   * @param { number } handle - indicates the handle of the init operation.
1675   * @param { HuksOptions } options - options indicates the properties of the finish operation.
1676   * @param { Uint8Array } token - token indicates the value of auth token from USER IAM service.
1677   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1678   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1679   *                                 1. Mandatory parameters are left unspecified.
1680   *                                 2. Incorrect parameter types.
1681   *                                 3. Parameter verification failed.
1682   * @throws { BusinessError } 801 - api is not supported
1683   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1684   * @throws { BusinessError } 12000002 - algorithm param is missing
1685   * @throws { BusinessError } 12000003 - algorithm param is invalid
1686   * @throws { BusinessError } 12000004 - operating file failed
1687   * @throws { BusinessError } 12000005 - IPC communication failed
1688   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1689   * @throws { BusinessError } 12000007 - this credential is already invalidated permanently
1690   * @throws { BusinessError } 12000008 - verify auth token failed
1691   * @throws { BusinessError } 12000009 - auth token is already timeout
1692   * @throws { BusinessError } 12000011 - queried entity does not exist
1693   * @throws { BusinessError } 12000012 - external error
1694   * @throws { BusinessError } 12000014 - memory is insufficient
1695   * @syscap SystemCapability.Security.Huks.Extension
1696   * @atomicservice
1697   * @since 11
1698   */
1699  function finishSession(handle: number, options: HuksOptions, token?: Uint8Array): Promise<HuksReturnResult>;
1700
1701  /**
1702   * Abort Operation.
1703   *
1704   * @param { number } handle - indicates the handle of the init operation.
1705   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1706   * @param { AsyncCallback<HuksResult> } callback - the callback of finishSession.
1707   * @syscap SystemCapability.Security.Huks.Extension
1708   * @since 8
1709   * @deprecated since 9
1710   * @useinstead ohos.security.huks.abortSession
1711   */
1712  function abort(handle: number, options: HuksOptions, callback: AsyncCallback<HuksResult>): void;
1713
1714  /**
1715   * Abort Operation.
1716   *
1717   * @param { number } handle - indicates the handle of the init operation.
1718   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1719   * @returns { Promise<HuksResult> } the promise returned by the function.
1720   * @syscap SystemCapability.Security.Huks.Extension
1721   * @since 8
1722   * @deprecated since 9
1723   * @useinstead ohos.security.huks.abortSession
1724   */
1725  function abort(handle: number, options: HuksOptions): Promise<HuksResult>;
1726
1727  /**
1728   * Abort Operation.
1729   *
1730   * @param { number } handle - indicates the handle of the init operation.
1731   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1732   * @param { AsyncCallback<void> } callback - the callback of abortSession.
1733   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1734   *                                 1. Mandatory parameters are left unspecified.
1735   *                                 2. Incorrect parameter types.
1736   *                                 3. Parameter verification failed.
1737   * @throws { BusinessError } 801 - api is not supported
1738   * @throws { BusinessError } 12000004 - operating file failed
1739   * @throws { BusinessError } 12000005 - IPC communication failed
1740   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1741   * @throws { BusinessError } 12000012 - external error
1742   * @throws { BusinessError } 12000014 - memory is insufficient
1743   * @syscap SystemCapability.Security.Huks.Core
1744   * @since 9
1745   */
1746  /**
1747   * Abort Operation.
1748   *
1749   * @param { number } handle - indicates the handle of the init operation.
1750   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1751   * @param { AsyncCallback<void> } callback - the callback of abortSession.
1752   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1753   *                                 1. Mandatory parameters are left unspecified.
1754   *                                 2. Incorrect parameter types.
1755   *                                 3. Parameter verification failed.
1756   * @throws { BusinessError } 801 - api is not supported
1757   * @throws { BusinessError } 12000004 - operating file failed
1758   * @throws { BusinessError } 12000005 - IPC communication failed
1759   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1760   * @throws { BusinessError } 12000012 - external error
1761   * @throws { BusinessError } 12000014 - memory is insufficient
1762   * @syscap SystemCapability.Security.Huks.Core
1763   * @atomicservice
1764   * @since 11
1765   */
1766  function abortSession(handle: number, options: HuksOptions, callback: AsyncCallback<void>): void;
1767
1768  /**
1769   * Abort Operation.
1770   *
1771   * @param { number } handle - indicates the handle of the init operation.
1772   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1773   * @returns { Promise<void> } the promise returned by the function.
1774   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1775   *                                 1. Mandatory parameters are left unspecified.
1776   *                                 2. Incorrect parameter types.
1777   *                                 3. Parameter verification failed.
1778   * @throws { BusinessError } 801 - api is not supported
1779   * @throws { BusinessError } 12000004 - operating file failed
1780   * @throws { BusinessError } 12000005 - IPC communication failed
1781   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1782   * @throws { BusinessError } 12000012 - external error
1783   * @throws { BusinessError } 12000014 - memory is insufficient
1784   * @syscap SystemCapability.Security.Huks.Extension
1785   * @since 9
1786   */
1787  /**
1788   * Abort Operation.
1789   *
1790   * @param { number } handle - indicates the handle of the init operation.
1791   * @param { HuksOptions } options - options indicates the properties of the abort operation.
1792   * @returns { Promise<void> } the promise returned by the function.
1793   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1794   *                                 1. Mandatory parameters are left unspecified.
1795   *                                 2. Incorrect parameter types.
1796   *                                 3. Parameter verification failed.
1797   * @throws { BusinessError } 801 - api is not supported
1798   * @throws { BusinessError } 12000004 - operating file failed
1799   * @throws { BusinessError } 12000005 - IPC communication failed
1800   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1801   * @throws { BusinessError } 12000012 - external error
1802   * @throws { BusinessError } 12000014 - memory is insufficient
1803   * @syscap SystemCapability.Security.Huks.Extension
1804   * @atomicservice
1805   * @since 11
1806   */
1807  function abortSession(handle: number, options: HuksOptions): Promise<void>;
1808
1809  /**
1810   * Key Attestation. This API can be called only by system applications.
1811   *
1812   * @permission ohos.permission.ATTEST_KEY
1813   * @param { string } keyAlias - keyAlias indicates the key's name.
1814   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
1815   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of attestKeyItem.
1816   * @throws { BusinessError } 201 - check permission failed
1817   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1818   *                                 1. Mandatory parameters are left unspecified.
1819   *                                 2. Incorrect parameter types.
1820   *                                 3. Parameter verification failed.
1821   * @throws { BusinessError } 801 - api is not supported
1822   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1823   * @throws { BusinessError } 12000002 - algorithm param is missing
1824   * @throws { BusinessError } 12000003 - algorithm param is invalid
1825   * @throws { BusinessError } 12000004 - operating file failed
1826   * @throws { BusinessError } 12000005 - IPC communication failed
1827   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1828   * @throws { BusinessError } 12000011 - queried entity does not exist
1829   * @throws { BusinessError } 12000012 - external error
1830   * @throws { BusinessError } 12000014 - memory is insufficient
1831   * @syscap SystemCapability.Security.Huks.Extension
1832   * @since 9
1833   */
1834  function attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksReturnResult>): void;
1835
1836  /**
1837   * Key Attestation As User.
1838   *
1839   * @permission ohos.permission.ATTEST_KEY and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
1840   * @param { number } userId - userId indicates the userId of the owner of the key.
1841   * @param { string } keyAlias - keyAlias indicates the key's name.
1842   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key attestation operation.
1843   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1844   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
1845   * <br>ohos.permission.ATTEST_KEY or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
1846   * @throws { BusinessError } 202 - not system app
1847   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1848   *                                 1. Mandatory parameters are left unspecified.
1849   *                                 2. Incorrect parameter types.
1850   *                                 3. Parameter verification failed.
1851   * @throws { BusinessError } 801 - api is not supported
1852   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1853   * @throws { BusinessError } 12000002 - algorithm param is missing
1854   * @throws { BusinessError } 12000003 - algorithm param is invalid
1855   * @throws { BusinessError } 12000004 - operating file failed
1856   * @throws { BusinessError } 12000005 - IPC communication failed
1857   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1858   * @throws { BusinessError } 12000011 - queried entity does not exist
1859   * @throws { BusinessError } 12000012 - external error
1860   * @throws { BusinessError } 12000014 - memory is insufficient
1861   * @syscap SystemCapability.Security.Huks.Extension
1862   * @systemapi this method can be used only by system applications.
1863   * @since 12
1864   */
1865  function attestKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<HuksReturnResult>;
1866
1867  /**
1868   * Key Attestation. This API can be called only by system applications.
1869   *
1870   * @permission ohos.permission.ATTEST_KEY
1871   * @param { string } keyAlias - keyAlias indicates the key's name.
1872   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
1873   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1874   * @throws { BusinessError } 201 - check permission failed
1875   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1876   *                                 1. Mandatory parameters are left unspecified.
1877   *                                 2. Incorrect parameter types.
1878   *                                 3. Parameter verification failed.
1879   * @throws { BusinessError } 801 - api is not supported
1880   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1881   * @throws { BusinessError } 12000002 - algorithm param is missing
1882   * @throws { BusinessError } 12000003 - algorithm param is invalid
1883   * @throws { BusinessError } 12000004 - operating file failed
1884   * @throws { BusinessError } 12000005 - IPC communication failed
1885   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1886   * @throws { BusinessError } 12000011 - queried entity does not exist
1887   * @throws { BusinessError } 12000012 - external error
1888   * @throws { BusinessError } 12000014 - memory is insufficient
1889   * @syscap SystemCapability.Security.Huks.Extension
1890   * @since 9
1891   */
1892  function attestKeyItem(keyAlias: string, options: HuksOptions): Promise<HuksReturnResult>;
1893
1894  /**
1895   * Key Attestation with anonymous certificate.
1896   *
1897   * @param { string } keyAlias - keyAlias indicates the key's name.
1898   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
1899   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of attestKeyItem.
1900   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1901   *                                 1. Mandatory parameters are left unspecified.
1902   *                                 2. Incorrect parameter types.
1903   *                                 3. Parameter verification failed.
1904   * @throws { BusinessError } 801 - api is not supported
1905   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1906   * @throws { BusinessError } 12000002 - algorithm param is missing
1907   * @throws { BusinessError } 12000003 - algorithm param is invalid
1908   * @throws { BusinessError } 12000004 - operating file failed
1909   * @throws { BusinessError } 12000005 - IPC communication failed
1910   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1911   * @throws { BusinessError } 12000011 - queried entity does not exist
1912   * @throws { BusinessError } 12000012 - external error
1913   * @throws { BusinessError } 12000014 - memory is insufficient
1914   * @syscap SystemCapability.Security.Huks.Extension
1915   * @since 11
1916   */
1917  /**
1918   * Key Attestation with anonymous certificate.
1919   *
1920   * @param { string } keyAlias - keyAlias indicates the key's name.
1921   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
1922   * @param { AsyncCallback<HuksReturnResult> } callback - the callback of attestKeyItem.
1923   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1924   *                                 1. Mandatory parameters are left unspecified.
1925   *                                 2. Incorrect parameter types.
1926   *                                 3. Parameter verification failed.
1927   * @throws { BusinessError } 801 - api is not supported
1928   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1929   * @throws { BusinessError } 12000002 - algorithm param is missing
1930   * @throws { BusinessError } 12000003 - algorithm param is invalid
1931   * @throws { BusinessError } 12000004 - operating file failed
1932   * @throws { BusinessError } 12000005 - IPC communication failed
1933   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1934   * @throws { BusinessError } 12000011 - queried entity does not exist
1935   * @throws { BusinessError } 12000012 - external error
1936   * @throws { BusinessError } 12000014 - memory is insufficient
1937   * @syscap SystemCapability.Security.Huks.Extension
1938   * @atomicservice
1939   * @since 12
1940   */
1941  function anonAttestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback<HuksReturnResult>): void;
1942
1943  /**
1944   * Key Attestation with anonymous certificate as user.
1945   *
1946   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
1947   * @param { number } userId - userId indicates the userId of the owner of the key.
1948   * @param { string } keyAlias - keyAlias indicates the key's name.
1949   * @param { HuksOptions } huksOptions - huksOptions indicates the properties of the key attestation operation.
1950   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1951   * @throws { BusinessError } 201 - Permission denied. An attempt was made to use key as user forbidden by permission:
1952   * <br>ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
1953   * @throws { BusinessError } 202 - not system app
1954   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1955   *                                 1. Mandatory parameters are left unspecified.
1956   *                                 2. Incorrect parameter types.
1957   *                                 3. Parameter verification failed.
1958   * @throws { BusinessError } 801 - api is not supported
1959   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1960   * @throws { BusinessError } 12000002 - algorithm param is missing
1961   * @throws { BusinessError } 12000003 - algorithm param is invalid
1962   * @throws { BusinessError } 12000004 - operating file failed
1963   * @throws { BusinessError } 12000005 - IPC communication failed
1964   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1965   * @throws { BusinessError } 12000011 - queried entity does not exist
1966   * @throws { BusinessError } 12000012 - external error
1967   * @throws { BusinessError } 12000014 - memory is insufficient
1968   * @syscap SystemCapability.Security.Huks.Extension
1969   * @systemapi this method can be used only by system applications.
1970   * @since 12
1971   */
1972  function anonAttestKeyItemAsUser(userId: number, keyAlias: string, huksOptions: HuksOptions): Promise<HuksReturnResult>;
1973
1974  /**
1975   * Key Attestation with anonymous certificate.
1976   *
1977   * @param { string } keyAlias - keyAlias indicates the key's name.
1978   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
1979   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
1980   * @throws { BusinessError } 401 - Parameter error. Possible causes:
1981   *                                 1. Mandatory parameters are left unspecified.
1982   *                                 2. Incorrect parameter types.
1983   *                                 3. Parameter verification failed.
1984   * @throws { BusinessError } 801 - api is not supported
1985   * @throws { BusinessError } 12000001 - algorithm mode is not supported
1986   * @throws { BusinessError } 12000002 - algorithm param is missing
1987   * @throws { BusinessError } 12000003 - algorithm param is invalid
1988   * @throws { BusinessError } 12000004 - operating file failed
1989   * @throws { BusinessError } 12000005 - IPC communication failed
1990   * @throws { BusinessError } 12000006 - error occurred in crypto engine
1991   * @throws { BusinessError } 12000011 - queried entity does not exist
1992   * @throws { BusinessError } 12000012 - external error
1993   * @throws { BusinessError } 12000014 - memory is insufficient
1994   * @syscap SystemCapability.Security.Huks.Extension
1995   * @since 11
1996   */
1997  /**
1998   * Key Attestation with anonymous certificate.
1999   *
2000   * @param { string } keyAlias - keyAlias indicates the key's name.
2001   * @param { HuksOptions } options - options indicates the properties of the key attestation operation.
2002   * @returns { Promise<HuksReturnResult> } the promise returned by the function.
2003   * @throws { BusinessError } 401 - Parameter error. Possible causes:
2004   *                                 1. Mandatory parameters are left unspecified.
2005   *                                 2. Incorrect parameter types.
2006   *                                 3. Parameter verification failed.
2007   * @throws { BusinessError } 801 - api is not supported
2008   * @throws { BusinessError } 12000001 - algorithm mode is not supported
2009   * @throws { BusinessError } 12000002 - algorithm param is missing
2010   * @throws { BusinessError } 12000003 - algorithm param is invalid
2011   * @throws { BusinessError } 12000004 - operating file failed
2012   * @throws { BusinessError } 12000005 - IPC communication failed
2013   * @throws { BusinessError } 12000006 - error occurred in crypto engine
2014   * @throws { BusinessError } 12000011 - queried entity does not exist
2015   * @throws { BusinessError } 12000012 - external error
2016   * @throws { BusinessError } 12000014 - memory is insufficient
2017   * @syscap SystemCapability.Security.Huks.Extension
2018   * @atomicservice
2019   * @since 12
2020   */
2021  function anonAttestKeyItem(keyAlias: string, options: HuksOptions): Promise<HuksReturnResult>;
2022
2023  /**
2024   * Get the sdk version.
2025   *
2026   * @param { HuksOptions } options - options indicates the properties of the key.
2027   * @returns { string } the character string of the sdk version.
2028   * @syscap SystemCapability.Security.Huks.Extension
2029   * @since 8
2030   * @deprecated since 11
2031   */
2032  function getSdkVersion(options: HuksOptions): string;
2033
2034  /**
2035   * list the key aliases.
2036   *
2037   * @param { HuksOptions } options - options indicates the properties of the key.
2038   * @returns { Promise<HuksListAliasesReturnResult> } the promise returned by the function.
2039   * @throws { BusinessError } 401 - Parameter error. Possible causes:
2040   *                                 1. Mandatory parameters are left unspecified.
2041   *                                 2. Incorrect parameter types.
2042   *                                 3. Parameter verification failed.
2043   * @throws { BusinessError } 12000004 - operating file failed
2044   * @throws { BusinessError } 12000005 - IPC communication failed
2045   * @throws { BusinessError } 12000012 - external error
2046   * @throws { BusinessError } 12000014 - memory is insufficient
2047   * @syscap SystemCapability.Security.Huks.Extension
2048   * @atomicservice
2049   * @since 12
2050   */
2051  function listAliases(options: HuksOptions): Promise<HuksListAliasesReturnResult>;
2052
2053  /**
2054   * Interface of huks param.
2055   *
2056   * @typedef HuksParam
2057   * @syscap SystemCapability.Security.Huks.Core
2058   * @since 8
2059   */
2060  /**
2061   * Interface of huks param.
2062   *
2063   * @typedef HuksParam
2064   * @syscap SystemCapability.Security.Huks.Core
2065   * @atomicservice
2066   * @since 11
2067   */
2068  export interface HuksParam {
2069    /**
2070     * @syscap SystemCapability.Security.Huks.Core
2071     * @since 8
2072     */
2073    /**
2074     * @type { HuksTag }
2075     * @syscap SystemCapability.Security.Huks.Core
2076     * @atomicservice
2077     * @since 11
2078     */
2079    tag: HuksTag;
2080    /**
2081     * @syscap SystemCapability.Security.Huks.Core
2082     * @since 8
2083     */
2084    /**
2085     * @type { boolean | number | bigint | Uint8Array }
2086     * @syscap SystemCapability.Security.Huks.Core
2087     * @atomicservice
2088     * @since 11
2089     */
2090    value: boolean | number | bigint | Uint8Array;
2091  }
2092
2093  /**
2094   * Interface of huks handle.
2095   *
2096   * @typedef HuksHandle
2097   * @syscap SystemCapability.Security.Huks.Extension
2098   * @since 8
2099   * @deprecated since 9
2100   * @useinstead ohos.security.huks.HuksSessionHandle
2101   */
2102  export interface HuksHandle {
2103    /**
2104     * @type { number }
2105     * @syscap SystemCapability.Security.Huks.Extension
2106     * @since 8
2107     * @deprecated since 9
2108     */
2109    errorCode: number;
2110    /**
2111     * @type { number }
2112     * @syscap SystemCapability.Security.Huks.Extension
2113     * @since 8
2114     * @deprecated since 9
2115     */
2116    handle: number;
2117    /**
2118     * @type { ?Uint8Array }
2119     * @syscap SystemCapability.Security.Huks.Extension
2120     * @since 8
2121     * @deprecated since 9
2122     */
2123    token?: Uint8Array;
2124  }
2125
2126  /**
2127   * Interface of huks handle.
2128   *
2129   * @typedef HuksSessionHandle
2130   * @syscap SystemCapability.Security.Huks.Core
2131   * @since 9
2132   */
2133  /**
2134   * Interface of huks handle.
2135   *
2136   * @typedef HuksSessionHandle
2137   * @syscap SystemCapability.Security.Huks.Core
2138   * @atomicservice
2139   * @since 11
2140   */
2141  export interface HuksSessionHandle {
2142    /**
2143     * @syscap SystemCapability.Security.Huks.Core
2144     * @since 9
2145     */
2146    /**
2147     * @type { number }
2148     * @syscap SystemCapability.Security.Huks.Core
2149     * @atomicservice
2150     * @since 11
2151     */
2152    handle: number;
2153    /**
2154     * @syscap SystemCapability.Security.Huks.Core
2155     * @since 9
2156     */
2157    /**
2158     * @type { ?Uint8Array }
2159     * @syscap SystemCapability.Security.Huks.Core
2160     * @atomicservice
2161     * @since 11
2162     */
2163    challenge?: Uint8Array;
2164  }
2165
2166  /**
2167   * Interface of huks option.
2168   *
2169   * @typedef HuksOptions
2170   * @syscap SystemCapability.Security.Huks.Core
2171   * @since 8
2172   */
2173  /**
2174   * Interface of huks option.
2175   *
2176   * @typedef HuksOptions
2177   * @syscap SystemCapability.Security.Huks.Core
2178   * @atomicservice
2179   * @since 11
2180   */
2181  export interface HuksOptions {
2182    /**
2183     * @syscap SystemCapability.Security.Huks.Core
2184     * @since 8
2185     */
2186    /**
2187     * @type { ?Array<HuksParam> }
2188     * @syscap SystemCapability.Security.Huks.Core
2189     * @atomicservice
2190     * @since 11
2191     */
2192    properties?: Array<HuksParam>;
2193    /**
2194     * @syscap SystemCapability.Security.Huks.Core
2195     * @since 8
2196     */
2197    /**
2198     * @type { ?Uint8Array }
2199     * @syscap SystemCapability.Security.Huks.Core
2200     * @atomicservice
2201     * @since 11
2202     */
2203    inData?: Uint8Array;
2204  }
2205
2206  /**
2207   * Interface of huks result.
2208   *
2209   * @typedef HuksResult
2210   * @syscap SystemCapability.Security.Huks.Extension
2211   * @since 8
2212   * @deprecated since 9
2213   * @useinstead ohos.security.huks.HuksReturnResult
2214   */
2215  export interface HuksResult {
2216    /**
2217     * @type { number }
2218     * @syscap SystemCapability.Security.Huks.Extension
2219     * @since 8
2220     * @deprecated since 9
2221     */
2222    errorCode: number;
2223    /**
2224     * @type { ?Uint8Array }
2225     * @syscap SystemCapability.Security.Huks.Extension
2226     * @since 8
2227     * @deprecated since 9
2228     */
2229    outData?: Uint8Array;
2230    /**
2231     * @type { ?Array<HuksParam> }
2232     * @syscap SystemCapability.Security.Huks.Extension
2233     * @since 8
2234     * @deprecated since 9
2235     */
2236    properties?: Array<HuksParam>;
2237    /**
2238     * @type { ?Array<string> }
2239     * @syscap SystemCapability.Security.Huks.Extension
2240     * @since 8
2241     * @deprecated since 9
2242     */
2243    certChains?: Array<string>;
2244  }
2245
2246  /**
2247   * Interface of huks result.
2248   *
2249   * @typedef HuksReturnResult
2250   * @syscap SystemCapability.Security.Huks.Core
2251   * @since 9
2252   */
2253  /**
2254   * Interface of huks result.
2255   *
2256   * @typedef HuksReturnResult
2257   * @syscap SystemCapability.Security.Huks.Core
2258   * @atomicservice
2259   * @since 11
2260   */
2261  export interface HuksReturnResult {
2262    /**
2263     * @syscap SystemCapability.Security.Huks.Core
2264     * @since 9
2265     */
2266    /**
2267     * @type { ?Uint8Array }
2268     * @syscap SystemCapability.Security.Huks.Core
2269     * @atomicservice
2270     * @since 11
2271     */
2272    outData?: Uint8Array;
2273    /**
2274     * @syscap SystemCapability.Security.Huks.Core
2275     * @since 9
2276     */
2277    /**
2278     * @type { ?Array<HuksParam> }
2279     * @syscap SystemCapability.Security.Huks.Core
2280     * @atomicservice
2281     * @since 11
2282     */
2283    properties?: Array<HuksParam>;
2284    /**
2285     * @syscap SystemCapability.Security.Huks.Core
2286     * @since 9
2287     */
2288    /**
2289     * @type { ?Array<string> }
2290     * @syscap SystemCapability.Security.Huks.Core
2291     * @atomicservice
2292     * @since 12
2293     */
2294    certChains?: Array<string>;
2295  }
2296
2297    /**
2298   * Interface of huks ListAliases result.
2299   *
2300   * @typedef HuksListAliasesReturnResult
2301   * @syscap SystemCapability.Security.Huks.Extension
2302   * @atomicservice
2303   * @since 12
2304   */
2305  export interface HuksListAliasesReturnResult {
2306
2307    /**
2308     * the returned list of key aliases
2309     *
2310     * @type { Array<string> }
2311     * @syscap SystemCapability.Security.Huks.Extension
2312     * @atomicservice
2313     * @since 12
2314     */
2315    keyAliases: Array<string>;
2316  }
2317
2318  /**
2319   * Enum for huks error code.
2320   *
2321   * @enum { number }
2322   * @syscap SystemCapability.Security.Huks.Extension
2323   * @since 8
2324   * @deprecated since 9
2325   * @useinstead ohos.security.huks.HuksExceptionErrCode
2326   */
2327  export enum HuksErrorCode {
2328    /**
2329     * @syscap SystemCapability.Security.Huks.Extension
2330     * @since 8
2331     * @deprecated since 9
2332     */
2333    HUKS_SUCCESS = 0,
2334    /**
2335     * @syscap SystemCapability.Security.Huks.Extension
2336     * @since 8
2337     * @deprecated since 9
2338     */
2339    HUKS_FAILURE = -1,
2340    /**
2341     * @syscap SystemCapability.Security.Huks.Extension
2342     * @since 8
2343     * @deprecated since 9
2344     */
2345    HUKS_ERROR_BAD_STATE = -2,
2346    /**
2347     * @syscap SystemCapability.Security.Huks.Extension
2348     * @since 8
2349     * @deprecated since 9
2350     */
2351    HUKS_ERROR_INVALID_ARGUMENT = -3,
2352    /**
2353     * @syscap SystemCapability.Security.Huks.Extension
2354     * @since 8
2355     * @deprecated since 9
2356     */
2357    HUKS_ERROR_NOT_SUPPORTED = -4,
2358    /**
2359     * @syscap SystemCapability.Security.Huks.Extension
2360     * @since 8
2361     * @deprecated since 9
2362     */
2363    HUKS_ERROR_NO_PERMISSION = -5,
2364    /**
2365     * @syscap SystemCapability.Security.Huks.Extension
2366     * @since 8
2367     * @deprecated since 9
2368     */
2369    HUKS_ERROR_INSUFFICIENT_DATA = -6,
2370    /**
2371     * @syscap SystemCapability.Security.Huks.Extension
2372     * @since 8
2373     * @deprecated since 9
2374     */
2375    HUKS_ERROR_BUFFER_TOO_SMALL = -7,
2376    /**
2377     * @syscap SystemCapability.Security.Huks.Extension
2378     * @since 8
2379     * @deprecated since 9
2380     */
2381    HUKS_ERROR_INSUFFICIENT_MEMORY = -8,
2382    /**
2383     * @syscap SystemCapability.Security.Huks.Extension
2384     * @since 8
2385     * @deprecated since 9
2386     */
2387    HUKS_ERROR_COMMUNICATION_FAILURE = -9,
2388    /**
2389     * @syscap SystemCapability.Security.Huks.Extension
2390     * @since 8
2391     * @deprecated since 9
2392     */
2393    HUKS_ERROR_STORAGE_FAILURE = -10,
2394    /**
2395     * @syscap SystemCapability.Security.Huks.Extension
2396     * @since 8
2397     * @deprecated since 9
2398     */
2399    HUKS_ERROR_HARDWARE_FAILURE = -11,
2400    /**
2401     * @syscap SystemCapability.Security.Huks.Extension
2402     * @since 8
2403     * @deprecated since 9
2404     */
2405    HUKS_ERROR_ALREADY_EXISTS = -12,
2406    /**
2407     * @syscap SystemCapability.Security.Huks.Extension
2408     * @since 8
2409     * @deprecated since 9
2410     */
2411    HUKS_ERROR_NOT_EXIST = -13,
2412    /**
2413     * @syscap SystemCapability.Security.Huks.Extension
2414     * @since 8
2415     * @deprecated since 9
2416     */
2417    HUKS_ERROR_NULL_POINTER = -14,
2418    /**
2419     * @syscap SystemCapability.Security.Huks.Extension
2420     * @since 8
2421     * @deprecated since 9
2422     */
2423    HUKS_ERROR_FILE_SIZE_FAIL = -15,
2424    /**
2425     * @syscap SystemCapability.Security.Huks.Extension
2426     * @since 8
2427     * @deprecated since 9
2428     */
2429    HUKS_ERROR_READ_FILE_FAIL = -16,
2430    /**
2431     * @syscap SystemCapability.Security.Huks.Extension
2432     * @since 8
2433     * @deprecated since 9
2434     */
2435    HUKS_ERROR_INVALID_PUBLIC_KEY = -17,
2436    /**
2437     * @syscap SystemCapability.Security.Huks.Extension
2438     * @since 8
2439     * @deprecated since 9
2440     */
2441    HUKS_ERROR_INVALID_PRIVATE_KEY = -18,
2442    /**
2443     * @syscap SystemCapability.Security.Huks.Extension
2444     * @since 8
2445     * @deprecated since 9
2446     */
2447    HUKS_ERROR_INVALID_KEY_INFO = -19,
2448    /**
2449     * @syscap SystemCapability.Security.Huks.Extension
2450     * @since 8
2451     * @deprecated since 9
2452     */
2453    HUKS_ERROR_HASH_NOT_EQUAL = -20,
2454    /**
2455     * @syscap SystemCapability.Security.Huks.Extension
2456     * @since 8
2457     * @deprecated since 9
2458     */
2459    HUKS_ERROR_MALLOC_FAIL = -21,
2460    /**
2461     * @syscap SystemCapability.Security.Huks.Extension
2462     * @since 8
2463     * @deprecated since 9
2464     */
2465    HUKS_ERROR_WRITE_FILE_FAIL = -22,
2466    /**
2467     * @syscap SystemCapability.Security.Huks.Extension
2468     * @since 8
2469     * @deprecated since 9
2470     */
2471    HUKS_ERROR_REMOVE_FILE_FAIL = -23,
2472    /**
2473     * @syscap SystemCapability.Security.Huks.Extension
2474     * @since 8
2475     * @deprecated since 9
2476     */
2477    HUKS_ERROR_OPEN_FILE_FAIL = -24,
2478    /**
2479     * @syscap SystemCapability.Security.Huks.Extension
2480     * @since 8
2481     * @deprecated since 9
2482     */
2483    HUKS_ERROR_CLOSE_FILE_FAIL = -25,
2484    /**
2485     * @syscap SystemCapability.Security.Huks.Extension
2486     * @since 8
2487     * @deprecated since 9
2488     */
2489    HUKS_ERROR_MAKE_DIR_FAIL = -26,
2490    /**
2491     * @syscap SystemCapability.Security.Huks.Extension
2492     * @since 8
2493     * @deprecated since 9
2494     */
2495    HUKS_ERROR_INVALID_KEY_FILE = -27,
2496    /**
2497     * @syscap SystemCapability.Security.Huks.Extension
2498     * @since 8
2499     * @deprecated since 9
2500     */
2501    HUKS_ERROR_IPC_MSG_FAIL = -28,
2502    /**
2503     * @syscap SystemCapability.Security.Huks.Extension
2504     * @since 8
2505     * @deprecated since 9
2506     */
2507    HUKS_ERROR_REQUEST_OVERFLOWS = -29,
2508    /**
2509     * @syscap SystemCapability.Security.Huks.Extension
2510     * @since 8
2511     * @deprecated since 9
2512     */
2513    HUKS_ERROR_PARAM_NOT_EXIST = -30,
2514    /**
2515     * @syscap SystemCapability.Security.Huks.Extension
2516     * @since 8
2517     * @deprecated since 9
2518     */
2519    HUKS_ERROR_CRYPTO_ENGINE_ERROR = -31,
2520    /**
2521     * @syscap SystemCapability.Security.Huks.Extension
2522     * @since 8
2523     * @deprecated since 9
2524     */
2525    HUKS_ERROR_COMMUNICATION_TIMEOUT = -32,
2526    /**
2527     * @syscap SystemCapability.Security.Huks.Extension
2528     * @since 8
2529     * @deprecated since 9
2530     */
2531    HUKS_ERROR_IPC_INIT_FAIL = -33,
2532    /**
2533     * @syscap SystemCapability.Security.Huks.Extension
2534     * @since 8
2535     * @deprecated since 9
2536     */
2537    HUKS_ERROR_IPC_DLOPEN_FAIL = -34,
2538    /**
2539     * @syscap SystemCapability.Security.Huks.Extension
2540     * @since 8
2541     * @deprecated since 9
2542     */
2543    HUKS_ERROR_EFUSE_READ_FAIL = -35,
2544    /**
2545     * @syscap SystemCapability.Security.Huks.Extension
2546     * @since 8
2547     * @deprecated since 9
2548     */
2549    HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST = -36,
2550    /**
2551     * @syscap SystemCapability.Security.Huks.Extension
2552     * @since 8
2553     * @deprecated since 9
2554     */
2555    HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL = -37,
2556    /**
2557     * @syscap SystemCapability.Security.Huks.Extension
2558     * @since 8
2559     * @deprecated since 9
2560     */
2561    HUKS_ERROR_VERIFICATION_FAILED = -38,
2562    /**
2563     * @syscap SystemCapability.Security.Huks.Extension
2564     * @since 8
2565     * @deprecated since 9
2566     */
2567    HUKS_ERROR_CHECK_GET_ALG_FAIL = -100,
2568    /**
2569     * @syscap SystemCapability.Security.Huks.Extension
2570     * @since 8
2571     * @deprecated since 9
2572     */
2573    HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL = -101,
2574    /**
2575     * @syscap SystemCapability.Security.Huks.Extension
2576     * @since 8
2577     * @deprecated since 9
2578     */
2579    HUKS_ERROR_CHECK_GET_PADDING_FAIL = -102,
2580    /**
2581     * @syscap SystemCapability.Security.Huks.Extension
2582     * @since 8
2583     * @deprecated since 9
2584     */
2585    HUKS_ERROR_CHECK_GET_PURPOSE_FAIL = -103,
2586    /**
2587     * @syscap SystemCapability.Security.Huks.Extension
2588     * @since 8
2589     * @deprecated since 9
2590     */
2591    HUKS_ERROR_CHECK_GET_DIGEST_FAIL = -104,
2592    /**
2593     * @syscap SystemCapability.Security.Huks.Extension
2594     * @since 8
2595     * @deprecated since 9
2596     */
2597    HUKS_ERROR_CHECK_GET_MODE_FAIL = -105,
2598    /**
2599     * @syscap SystemCapability.Security.Huks.Extension
2600     * @since 8
2601     * @deprecated since 9
2602     */
2603    HUKS_ERROR_CHECK_GET_NONCE_FAIL = -106,
2604    /**
2605     * @syscap SystemCapability.Security.Huks.Extension
2606     * @since 8
2607     * @deprecated since 9
2608     */
2609    HUKS_ERROR_CHECK_GET_AAD_FAIL = -107,
2610    /**
2611     * @syscap SystemCapability.Security.Huks.Extension
2612     * @since 8
2613     * @deprecated since 9
2614     */
2615    HUKS_ERROR_CHECK_GET_IV_FAIL = -108,
2616    /**
2617     * @syscap SystemCapability.Security.Huks.Extension
2618     * @since 8
2619     * @deprecated since 9
2620     */
2621    HUKS_ERROR_CHECK_GET_AE_TAG_FAIL = -109,
2622    /**
2623     * @syscap SystemCapability.Security.Huks.Extension
2624     * @since 8
2625     * @deprecated since 9
2626     */
2627    HUKS_ERROR_CHECK_GET_SALT_FAIL = -110,
2628    /**
2629     * @syscap SystemCapability.Security.Huks.Extension
2630     * @since 8
2631     * @deprecated since 9
2632     */
2633    HUKS_ERROR_CHECK_GET_ITERATION_FAIL = -111,
2634    /**
2635     * @syscap SystemCapability.Security.Huks.Extension
2636     * @since 8
2637     * @deprecated since 9
2638     */
2639    HUKS_ERROR_INVALID_ALGORITHM = -112,
2640    /**
2641     * @syscap SystemCapability.Security.Huks.Extension
2642     * @since 8
2643     * @deprecated since 9
2644     */
2645    HUKS_ERROR_INVALID_KEY_SIZE = -113,
2646    /**
2647     * @syscap SystemCapability.Security.Huks.Extension
2648     * @since 8
2649     * @deprecated since 9
2650     */
2651    HUKS_ERROR_INVALID_PADDING = -114,
2652    /**
2653     * @syscap SystemCapability.Security.Huks.Extension
2654     * @since 8
2655     * @deprecated since 9
2656     */
2657    HUKS_ERROR_INVALID_PURPOSE = -115,
2658    /**
2659     * @syscap SystemCapability.Security.Huks.Extension
2660     * @since 8
2661     * @deprecated since 9
2662     */
2663    HUKS_ERROR_INVALID_MODE = -116,
2664    /**
2665     * @syscap SystemCapability.Security.Huks.Extension
2666     * @since 8
2667     * @deprecated since 9
2668     */
2669    HUKS_ERROR_INVALID_DIGEST = -117,
2670    /**
2671     * @syscap SystemCapability.Security.Huks.Extension
2672     * @since 8
2673     * @deprecated since 9
2674     */
2675    HUKS_ERROR_INVALID_SIGNATURE_SIZE = -118,
2676    /**
2677     * @syscap SystemCapability.Security.Huks.Extension
2678     * @since 8
2679     * @deprecated since 9
2680     */
2681    HUKS_ERROR_INVALID_IV = -119,
2682    /**
2683     * @syscap SystemCapability.Security.Huks.Extension
2684     * @since 8
2685     * @deprecated since 9
2686     */
2687    HUKS_ERROR_INVALID_AAD = -120,
2688    /**
2689     * @syscap SystemCapability.Security.Huks.Extension
2690     * @since 8
2691     * @deprecated since 9
2692     */
2693    HUKS_ERROR_INVALID_NONCE = -121,
2694    /**
2695     * @syscap SystemCapability.Security.Huks.Extension
2696     * @since 8
2697     * @deprecated since 9
2698     */
2699    HUKS_ERROR_INVALID_AE_TAG = -122,
2700    /**
2701     * @syscap SystemCapability.Security.Huks.Extension
2702     * @since 8
2703     * @deprecated since 9
2704     */
2705    HUKS_ERROR_INVALID_SALT = -123,
2706    /**
2707     * @syscap SystemCapability.Security.Huks.Extension
2708     * @since 8
2709     * @deprecated since 9
2710     */
2711    HUKS_ERROR_INVALID_ITERATION = -124,
2712    /**
2713     * @syscap SystemCapability.Security.Huks.Extension
2714     * @since 8
2715     * @deprecated since 9
2716     */
2717    HUKS_ERROR_INVALID_OPERATION = -125,
2718    /**
2719     * @syscap SystemCapability.Security.Huks.Extension
2720     * @since 8
2721     * @deprecated since 9
2722     */
2723    HUKS_ERROR_INTERNAL_ERROR = -999,
2724    /**
2725     * @syscap SystemCapability.Security.Huks.Extension
2726     * @since 8
2727     * @deprecated since 9
2728     */
2729    HUKS_ERROR_UNKNOWN_ERROR = -1000
2730  }
2731
2732  /**
2733   * Enum for huks exception error code.
2734   *
2735   * @enum { number }
2736   * @syscap SystemCapability.Security.Huks.Core
2737   * @since 9
2738   */
2739  /**
2740   * Enum for huks exception error code.
2741   *
2742   * @enum { number }
2743   * @syscap SystemCapability.Security.Huks.Core
2744   * @atomicservice
2745   * @since 11
2746   */
2747  export enum HuksExceptionErrCode {
2748    /**
2749     * @syscap SystemCapability.Security.Huks.Core
2750     * @since 9
2751     */
2752    /**
2753     * @syscap SystemCapability.Security.Huks.Core
2754     * @atomicservice
2755     * @since 11
2756     */
2757    HUKS_ERR_CODE_PERMISSION_FAIL = 201,
2758    /**
2759     * Non-system applications are not allowed to use system APIs.
2760     *
2761     * @syscap SystemCapability.Security.Huks.Core
2762     * @since 12
2763     */
2764    HUKS_ERR_CODE_NOT_SYSTEM_APP = 202,
2765    /**
2766     * @syscap SystemCapability.Security.Huks.Core
2767     * @since 9
2768     */
2769    /**
2770     * @syscap SystemCapability.Security.Huks.Core
2771     * @atomicservice
2772     * @since 11
2773     */
2774    HUKS_ERR_CODE_ILLEGAL_ARGUMENT = 401,
2775    /**
2776     * @syscap SystemCapability.Security.Huks.Core
2777     * @since 9
2778     */
2779    /**
2780     * @syscap SystemCapability.Security.Huks.Core
2781     * @atomicservice
2782     * @since 11
2783     */
2784    HUKS_ERR_CODE_NOT_SUPPORTED_API = 801,
2785    /**
2786     * @syscap SystemCapability.Security.Huks.Core
2787     * @since 9
2788     */
2789    /**
2790     * @syscap SystemCapability.Security.Huks.Core
2791     * @atomicservice
2792     * @since 11
2793     */
2794    HUKS_ERR_CODE_FEATURE_NOT_SUPPORTED = 12000001,
2795    /**
2796     * @syscap SystemCapability.Security.Huks.Core
2797     * @since 9
2798     */
2799    /**
2800     * @syscap SystemCapability.Security.Huks.Core
2801     * @atomicservice
2802     * @since 11
2803     */
2804    HUKS_ERR_CODE_MISSING_CRYPTO_ALG_ARGUMENT = 12000002,
2805    /**
2806     * @syscap SystemCapability.Security.Huks.Core
2807     * @since 9
2808     */
2809    /**
2810     * @syscap SystemCapability.Security.Huks.Core
2811     * @atomicservice
2812     * @since 11
2813     */
2814    HUKS_ERR_CODE_INVALID_CRYPTO_ALG_ARGUMENT = 12000003,
2815    /**
2816     * @syscap SystemCapability.Security.Huks.Core
2817     * @since 9
2818     */
2819    /**
2820     * @syscap SystemCapability.Security.Huks.Core
2821     * @atomicservice
2822     * @since 11
2823     */
2824    HUKS_ERR_CODE_FILE_OPERATION_FAIL = 12000004,
2825    /**
2826     * @syscap SystemCapability.Security.Huks.Core
2827     * @since 9
2828     */
2829    /**
2830     * @syscap SystemCapability.Security.Huks.Core
2831     * @atomicservice
2832     * @since 11
2833     */
2834    HUKS_ERR_CODE_COMMUNICATION_FAIL = 12000005,
2835    /**
2836     * @syscap SystemCapability.Security.Huks.Core
2837     * @since 9
2838     */
2839    /**
2840     * @syscap SystemCapability.Security.Huks.Core
2841     * @atomicservice
2842     * @since 11
2843     */
2844    HUKS_ERR_CODE_CRYPTO_FAIL = 12000006,
2845    /**
2846     * @syscap SystemCapability.Security.Huks.Core
2847     * @since 9
2848     */
2849    /**
2850     * @syscap SystemCapability.Security.Huks.Core
2851     * @atomicservice
2852     * @since 11
2853     */
2854    HUKS_ERR_CODE_KEY_AUTH_PERMANENTLY_INVALIDATED = 12000007,
2855    /**
2856     * @syscap SystemCapability.Security.Huks.Core
2857     * @since 9
2858     */
2859    /**
2860     * @syscap SystemCapability.Security.Huks.Core
2861     * @atomicservice
2862     * @since 11
2863     */
2864    HUKS_ERR_CODE_KEY_AUTH_VERIFY_FAILED = 12000008,
2865    /**
2866     * @syscap SystemCapability.Security.Huks.Core
2867     * @since 9
2868     */
2869    /**
2870     * @syscap SystemCapability.Security.Huks.Core
2871     * @atomicservice
2872     * @since 11
2873     */
2874    HUKS_ERR_CODE_KEY_AUTH_TIME_OUT = 12000009,
2875    /**
2876     * @syscap SystemCapability.Security.Huks.Core
2877     * @since 9
2878     */
2879    /**
2880     * @syscap SystemCapability.Security.Huks.Core
2881     * @atomicservice
2882     * @since 11
2883     */
2884    HUKS_ERR_CODE_SESSION_LIMIT = 12000010,
2885    /**
2886     * @syscap SystemCapability.Security.Huks.Core
2887     * @since 9
2888     */
2889    /**
2890     * @syscap SystemCapability.Security.Huks.Core
2891     * @atomicservice
2892     * @since 11
2893     */
2894    HUKS_ERR_CODE_ITEM_NOT_EXIST = 12000011,
2895    /**
2896     * @syscap SystemCapability.Security.Huks.Core
2897     * @since 9
2898     */
2899    /**
2900     * @syscap SystemCapability.Security.Huks.Core
2901     * @atomicservice
2902     * @since 11
2903     */
2904    HUKS_ERR_CODE_EXTERNAL_ERROR = 12000012,
2905    /**
2906     * @syscap SystemCapability.Security.Huks.Core
2907     * @since 9
2908     */
2909    /**
2910     * @syscap SystemCapability.Security.Huks.Core
2911     * @atomicservice
2912     * @since 11
2913     */
2914    HUKS_ERR_CODE_CREDENTIAL_NOT_EXIST = 12000013,
2915    /**
2916     * @syscap SystemCapability.Security.Huks.Core
2917     * @since 9
2918     */
2919    /**
2920     * @syscap SystemCapability.Security.Huks.Core
2921     * @atomicservice
2922     * @since 11
2923     */
2924    HUKS_ERR_CODE_INSUFFICIENT_MEMORY = 12000014,
2925    /**
2926     * @syscap SystemCapability.Security.Huks.Core
2927     * @since 9
2928     */
2929    /**
2930     * @syscap SystemCapability.Security.Huks.Core
2931     * @atomicservice
2932     * @since 11
2933     */
2934    HUKS_ERR_CODE_CALL_SERVICE_FAILED = 12000015,
2935    /**
2936     * A device password is required but not set.
2937     *
2938     * @syscap SystemCapability.Security.Huks.Extension
2939     * @since 11
2940     */
2941    /**
2942     * A device password is required but not set.
2943     *
2944     * @syscap SystemCapability.Security.Huks.Extension
2945     * @atomicservice
2946     * @since 12
2947     */
2948    HUKS_ERR_CODE_DEVICE_PASSWORD_UNSET = 12000016
2949  }
2950
2951  /**
2952   * Enum for huks key purpose.
2953   *
2954   * @enum { number }
2955   * @syscap SystemCapability.Security.Huks.Core
2956   * @since 8
2957   */
2958  /**
2959   * Enum for huks key purpose.
2960   *
2961   * @enum { number }
2962   * @syscap SystemCapability.Security.Huks.Core
2963   * @atomicservice
2964   * @since 11
2965   */
2966  export enum HuksKeyPurpose {
2967    /**
2968     * Usable with RSA, EC and AES keys.
2969     *
2970     * @syscap SystemCapability.Security.Huks.Core
2971     * @since 8
2972     */
2973    /**
2974     * Usable with RSA, EC and AES keys.
2975     *
2976     * @syscap SystemCapability.Security.Huks.Core
2977     * @atomicservice
2978     * @since 11
2979     */
2980    HUKS_KEY_PURPOSE_ENCRYPT = 1,
2981    /**
2982     * Usable with RSA, EC and AES keys.
2983     *
2984     * @syscap SystemCapability.Security.Huks.Core
2985     * @since 8
2986     */
2987    /**
2988     * Usable with RSA, EC and AES keys.
2989     *
2990     * @syscap SystemCapability.Security.Huks.Core
2991     * @atomicservice
2992     * @since 11
2993     */
2994    HUKS_KEY_PURPOSE_DECRYPT = 2,
2995    /**
2996     * Usable with RSA, EC keys.
2997     * @syscap SystemCapability.Security.Huks.Extension
2998     * @since 8
2999     */
3000    /**
3001     * Usable with RSA, EC keys.
3002     * @syscap SystemCapability.Security.Huks.Core
3003     * @atomicservice
3004     * @since 12
3005     */
3006    HUKS_KEY_PURPOSE_SIGN = 4,
3007    /**
3008     * Usable with RSA, EC keys.
3009     * @syscap SystemCapability.Security.Huks.Extension
3010     * @since 8
3011     */
3012    /**
3013     * Usable with RSA, EC keys.
3014     * @syscap SystemCapability.Security.Huks.Core
3015     * @atomicservice
3016     * @since 12
3017     */
3018    HUKS_KEY_PURPOSE_VERIFY = 8,
3019    /**
3020     * Usable with EC keys.
3021     * @syscap SystemCapability.Security.Huks.Extension
3022     * @since 8
3023     */
3024    /**
3025     * Usable with EC keys.
3026     * @syscap SystemCapability.Security.Huks.Core
3027     * @atomicservice
3028     * @since 12
3029     */
3030    HUKS_KEY_PURPOSE_DERIVE = 16,
3031    /**
3032     * Usable with wrap key.
3033     * @syscap SystemCapability.Security.Huks.Extension
3034     * @since 8
3035     */
3036    /**
3037     * Usable with wrap key.
3038     * @syscap SystemCapability.Security.Huks.Core
3039     * @atomicservice
3040     * @since 12
3041     */
3042    HUKS_KEY_PURPOSE_WRAP = 32,
3043    /**
3044     * Usable with unwrap key.
3045     * @syscap SystemCapability.Security.Huks.Extension
3046     * @since 8
3047     */
3048    /**
3049     * Usable with unwrap key.
3050     * @syscap SystemCapability.Security.Huks.Core
3051     * @atomicservice
3052     * @since 12
3053     */
3054    HUKS_KEY_PURPOSE_UNWRAP = 64,
3055    /**
3056     * Usable with mac.
3057     * @syscap SystemCapability.Security.Huks.Extension
3058     * @since 8
3059     */
3060    /**
3061     * Usable with mac.
3062     * @syscap SystemCapability.Security.Huks.Core
3063     * @atomicservice
3064     * @since 12
3065     */
3066    HUKS_KEY_PURPOSE_MAC = 128,
3067    /**
3068     * Usable with agree.
3069     * @syscap SystemCapability.Security.Huks.Extension
3070     * @since 8
3071     */
3072    /**
3073     * Usable with agree.
3074     * @syscap SystemCapability.Security.Huks.Core
3075     * @atomicservice
3076     * @since 12
3077     */
3078    HUKS_KEY_PURPOSE_AGREE = 256
3079  }
3080
3081  /**
3082   * Enum for huks key digest.
3083   *
3084   * @enum { number }
3085   * @syscap SystemCapability.Security.Huks.Extension
3086   * @since 8
3087   */
3088  /**
3089   * Enum for huks key digest.
3090   *
3091   * @enum { number }
3092   * @syscap SystemCapability.Security.Huks.Core
3093   * @atomicservice
3094   * @since 12
3095   */
3096  export enum HuksKeyDigest {
3097    /**
3098     * @syscap SystemCapability.Security.Huks.Extension
3099     * @since 8
3100     */
3101    /**
3102     * @syscap SystemCapability.Security.Huks.Core
3103     * @atomicservice
3104     * @since 12
3105     */
3106    HUKS_DIGEST_NONE = 0,
3107    /**
3108     * @syscap SystemCapability.Security.Huks.Extension
3109     * @since 8
3110     */
3111    /**
3112     * @syscap SystemCapability.Security.Huks.Core
3113     * @atomicservice
3114     * @since 12
3115     */
3116    HUKS_DIGEST_MD5 = 1,
3117    /**
3118     * @syscap SystemCapability.Security.Huks.Extension
3119     * @since 9
3120     */
3121    /**
3122     * @syscap SystemCapability.Security.Huks.Core
3123     * @atomicservice
3124     * @since 12
3125     */
3126    HUKS_DIGEST_SM3 = 2,
3127    /**
3128     * @syscap SystemCapability.Security.Huks.Extension
3129     * @since 8
3130     */
3131    /**
3132     * @syscap SystemCapability.Security.Huks.Core
3133     * @atomicservice
3134     * @since 12
3135     */
3136    HUKS_DIGEST_SHA1 = 10,
3137    /**
3138     * @syscap SystemCapability.Security.Huks.Extension
3139     * @since 8
3140     */
3141    /**
3142     * @syscap SystemCapability.Security.Huks.Core
3143     * @atomicservice
3144     * @since 12
3145     */
3146    HUKS_DIGEST_SHA224 = 11,
3147    /**
3148     * @syscap SystemCapability.Security.Huks.Extension
3149     * @since 8
3150     */
3151    /**
3152     * @syscap SystemCapability.Security.Huks.Core
3153     * @atomicservice
3154     * @since 12
3155     */
3156    HUKS_DIGEST_SHA256 = 12,
3157    /**
3158     * @syscap SystemCapability.Security.Huks.Extension
3159     * @since 8
3160     */
3161    /**
3162     * @syscap SystemCapability.Security.Huks.Core
3163     * @atomicservice
3164     * @since 12
3165     */
3166    HUKS_DIGEST_SHA384 = 13,
3167    /**
3168     * @syscap SystemCapability.Security.Huks.Extension
3169     * @since 8
3170     */
3171    /**
3172     * @syscap SystemCapability.Security.Huks.Core
3173     * @atomicservice
3174     * @since 12
3175     */
3176    HUKS_DIGEST_SHA512 = 14
3177  }
3178
3179  /**
3180   * Enum for huks key padding.
3181   *
3182   * @enum { number }
3183   * @syscap SystemCapability.Security.Huks.Core
3184   * @since 8
3185   */
3186  /**
3187   * Enum for huks key padding.
3188   *
3189   * @enum { number }
3190   * @syscap SystemCapability.Security.Huks.Core
3191   * @atomicservice
3192   * @since 11
3193   */
3194  export enum HuksKeyPadding {
3195    /**
3196     * @syscap SystemCapability.Security.Huks.Core
3197     * @since 8
3198     */
3199    /**
3200     * @syscap SystemCapability.Security.Huks.Core
3201     * @atomicservice
3202     * @since 11
3203     */
3204    HUKS_PADDING_NONE = 0,
3205    /**
3206     * @syscap SystemCapability.Security.Huks.Extension
3207     * @since 8
3208     */
3209    /**
3210     * @syscap SystemCapability.Security.Huks.Core
3211     * @atomicservice
3212     * @since 12
3213     */
3214    HUKS_PADDING_OAEP = 1,
3215    /**
3216     * @syscap SystemCapability.Security.Huks.Extension
3217     * @since 8
3218     */
3219    /**
3220     * @syscap SystemCapability.Security.Huks.Core
3221     * @atomicservice
3222     * @since 12
3223     */
3224    HUKS_PADDING_PSS = 2,
3225    /**
3226     * @syscap SystemCapability.Security.Huks.Extension
3227     * @since 8
3228     */
3229    /**
3230     * @syscap SystemCapability.Security.Huks.Core
3231     * @atomicservice
3232     * @since 12
3233     */
3234    HUKS_PADDING_PKCS1_V1_5 = 3,
3235    /**
3236     * @syscap SystemCapability.Security.Huks.Extension
3237     * @since 8
3238     */
3239    /**
3240     * @syscap SystemCapability.Security.Huks.Core
3241     * @atomicservice
3242     * @since 12
3243     */
3244    HUKS_PADDING_PKCS5 = 4,
3245    /**
3246     * @syscap SystemCapability.Security.Huks.Core
3247     * @since 8
3248     */
3249    /**
3250     * @syscap SystemCapability.Security.Huks.Core
3251     * @atomicservice
3252     * @since 12
3253     */
3254    HUKS_PADDING_PKCS7 = 5,
3255    /**
3256     * @syscap SystemCapability.Security.Huks.Core
3257     * @atomicservice
3258     * @since 12
3259     */
3260    HUKS_PADDING_ISO_IEC_9796_2 = 6,
3261    /**
3262     * @syscap SystemCapability.Security.Huks.Core
3263     * @atomicservice
3264     * @since 12
3265     */
3266    HUKS_PADDING_ISO_IEC_9797_1 = 7,
3267  }
3268
3269  /**
3270   * Enum for huks cipher mode.
3271   *
3272   * @enum { number }
3273   * @syscap SystemCapability.Security.Huks.Core
3274   * @since 8
3275   */
3276  /**
3277   * Enum for huks cipher mode.
3278   *
3279   * @enum { number }
3280   * @syscap SystemCapability.Security.Huks.Core
3281   * @atomicservice
3282   * @since 11
3283   */
3284  export enum HuksCipherMode {
3285    /**
3286     * @syscap SystemCapability.Security.Huks.Core
3287     * @since 8
3288     */
3289    /**
3290     * @syscap SystemCapability.Security.Huks.Core
3291     * @atomicservice
3292     * @since 12
3293     */
3294    HUKS_MODE_ECB = 1,
3295    /**
3296     * @syscap SystemCapability.Security.Huks.Core
3297     * @since 8
3298     */
3299    /**
3300     * @syscap SystemCapability.Security.Huks.Core
3301     * @atomicservice
3302     * @since 12
3303     */
3304    HUKS_MODE_CBC = 2,
3305    /**
3306     * @syscap SystemCapability.Security.Huks.Core
3307     * @since 8
3308     */
3309    /**
3310     * @syscap SystemCapability.Security.Huks.Core
3311     * @atomicservice
3312     * @since 12
3313     */
3314    HUKS_MODE_CTR = 3,
3315    /**
3316     * @syscap SystemCapability.Security.Huks.Extension
3317     * @since 8
3318     */
3319    /**
3320     * @syscap SystemCapability.Security.Huks.Core
3321     * @atomicservice
3322     * @since 12
3323     */
3324    HUKS_MODE_OFB = 4,
3325    /**
3326     * Cipher Feedback (CFB) mode
3327     *
3328     * @syscap SystemCapability.Security.Huks.Core
3329     * @atomicservice
3330     * @since 12
3331     */
3332    HUKS_MODE_CFB = 5,
3333    /**
3334     * @syscap SystemCapability.Security.Huks.Extension
3335     * @since 8
3336     */
3337    /**
3338     * @syscap SystemCapability.Security.Huks.Core
3339     * @atomicservice
3340     * @since 12
3341     */
3342    HUKS_MODE_CCM = 31,
3343
3344    /**
3345     * @syscap SystemCapability.Security.Huks.Core
3346     * @since 8
3347     */
3348    /**
3349     * @syscap SystemCapability.Security.Huks.Core
3350     * @atomicservice
3351     * @since 11
3352     */
3353    HUKS_MODE_GCM = 32
3354  }
3355
3356  /**
3357   * Enum for huks key size.
3358   *
3359   * @enum { number }
3360   * @syscap SystemCapability.Security.Huks.Core
3361   * @since 8
3362   */
3363  /**
3364   * Enum for huks key size.
3365   *
3366   * @enum { number }
3367   * @syscap SystemCapability.Security.Huks.Core
3368   * @atomicservice
3369   * @since 11
3370   */
3371  export enum HuksKeySize {
3372    /**
3373     * @syscap SystemCapability.Security.Huks.Extension
3374     * @since 8
3375     */
3376    /**
3377     * @syscap SystemCapability.Security.Huks.Core
3378     * @atomicservice
3379     * @since 12
3380     */
3381    HUKS_RSA_KEY_SIZE_512 = 512,
3382    /**
3383     * @syscap SystemCapability.Security.Huks.Extension
3384     * @since 8
3385     */
3386    /**
3387     * @syscap SystemCapability.Security.Huks.Core
3388     * @atomicservice
3389     * @since 12
3390     */
3391    HUKS_RSA_KEY_SIZE_768 = 768,
3392    /**
3393     * @syscap SystemCapability.Security.Huks.Extension
3394     * @since 8
3395     */
3396    /**
3397     * @syscap SystemCapability.Security.Huks.Core
3398     * @atomicservice
3399     * @since 12
3400     */
3401    HUKS_RSA_KEY_SIZE_1024 = 1024,
3402    /**
3403     * @syscap SystemCapability.Security.Huks.Extension
3404     * @since 8
3405     */
3406    /**
3407     * @syscap SystemCapability.Security.Huks.Core
3408     * @atomicservice
3409     * @since 12
3410     */
3411    HUKS_RSA_KEY_SIZE_2048 = 2048,
3412    /**
3413     * @syscap SystemCapability.Security.Huks.Extension
3414     * @since 8
3415     */
3416    /**
3417     * @syscap SystemCapability.Security.Huks.Core
3418     * @atomicservice
3419     * @since 12
3420     */
3421    HUKS_RSA_KEY_SIZE_3072 = 3072,
3422    /**
3423     * @syscap SystemCapability.Security.Huks.Extension
3424     * @since 8
3425     */
3426    /**
3427     * @syscap SystemCapability.Security.Huks.Core
3428     * @atomicservice
3429     * @since 12
3430     */
3431    HUKS_RSA_KEY_SIZE_4096 = 4096,
3432
3433    /**
3434     * @syscap SystemCapability.Security.Huks.Extension
3435     * @since 8
3436     */
3437    /**
3438     * @syscap SystemCapability.Security.Huks.Core
3439     * @atomicservice
3440     * @since 12
3441     */
3442    HUKS_ECC_KEY_SIZE_224 = 224,
3443    /**
3444     * @syscap SystemCapability.Security.Huks.Extension
3445     * @since 8
3446     */
3447    /**
3448     * @syscap SystemCapability.Security.Huks.Core
3449     * @atomicservice
3450     * @since 12
3451     */
3452    HUKS_ECC_KEY_SIZE_256 = 256,
3453    /**
3454     * @syscap SystemCapability.Security.Huks.Extension
3455     * @since 8
3456     */
3457    /**
3458     * @syscap SystemCapability.Security.Huks.Core
3459     * @atomicservice
3460     * @since 12
3461     */
3462    HUKS_ECC_KEY_SIZE_384 = 384,
3463    /**
3464     * @syscap SystemCapability.Security.Huks.Extension
3465     * @since 8
3466     */
3467    /**
3468     * @syscap SystemCapability.Security.Huks.Core
3469     * @atomicservice
3470     * @since 12
3471     */
3472    HUKS_ECC_KEY_SIZE_521 = 521,
3473
3474    /**
3475     * @syscap SystemCapability.Security.Huks.Core
3476     * @since 8
3477     */
3478    /**
3479     * @syscap SystemCapability.Security.Huks.Core
3480     * @atomicservice
3481     * @since 11
3482     */
3483    HUKS_AES_KEY_SIZE_128 = 128,
3484    /**
3485     * @syscap SystemCapability.Security.Huks.Core
3486     * @since 8
3487     */
3488    /**
3489     * @syscap SystemCapability.Security.Huks.Core
3490     * @atomicservice
3491     * @since 11
3492     */
3493    HUKS_AES_KEY_SIZE_192 = 192,
3494    /**
3495     * @syscap SystemCapability.Security.Huks.Core
3496     * @since 8
3497     */
3498    /**
3499     * @syscap SystemCapability.Security.Huks.Core
3500     * @atomicservice
3501     * @since 11
3502     */
3503    HUKS_AES_KEY_SIZE_256 = 256,
3504
3505    /**
3506     * @syscap SystemCapability.Security.Huks.Core
3507     * @since 8
3508     * @deprecated since 11
3509     */
3510    HUKS_AES_KEY_SIZE_512 = 512,
3511
3512    /**
3513     * @syscap SystemCapability.Security.Huks.Extension
3514     * @since 8
3515     */
3516    /**
3517     * @syscap SystemCapability.Security.Huks.Core
3518     * @atomicservice
3519     * @since 12
3520     */
3521    HUKS_CURVE25519_KEY_SIZE_256 = 256,
3522
3523    /**
3524     * @syscap SystemCapability.Security.Huks.Extension
3525     * @since 8
3526     */
3527    /**
3528     * @syscap SystemCapability.Security.Huks.Core
3529     * @atomicservice
3530     * @since 12
3531     */
3532    HUKS_DH_KEY_SIZE_2048 = 2048,
3533    /**
3534     * @syscap SystemCapability.Security.Huks.Extension
3535     * @since 8
3536     */
3537    /**
3538     * @syscap SystemCapability.Security.Huks.Core
3539     * @atomicservice
3540     * @since 12
3541     */
3542    HUKS_DH_KEY_SIZE_3072 = 3072,
3543    /**
3544     * @syscap SystemCapability.Security.Huks.Extension
3545     * @since 8
3546     */
3547    /**
3548     * @syscap SystemCapability.Security.Huks.Core
3549     * @atomicservice
3550     * @since 12
3551     */
3552    HUKS_DH_KEY_SIZE_4096 = 4096,
3553
3554    /**
3555     * @syscap SystemCapability.Security.Huks.Extension
3556     * @since 9
3557     */
3558    /**
3559     * @syscap SystemCapability.Security.Huks.Core
3560     * @atomicservice
3561     * @since 12
3562     */
3563    HUKS_SM2_KEY_SIZE_256 = 256,
3564    /**
3565     * @syscap SystemCapability.Security.Huks.Extension
3566     * @since 9
3567     */
3568    /**
3569     * @syscap SystemCapability.Security.Huks.Core
3570     * @atomicservice
3571     * @since 12
3572     */
3573    HUKS_SM4_KEY_SIZE_128 = 128,
3574    /**
3575     * @syscap SystemCapability.Security.Huks.Core
3576     * @atomicservice
3577     * @since 12
3578     */
3579    HUKS_DES_KEY_SIZE_64 = 64,
3580    /**
3581     * @syscap SystemCapability.Security.Huks.Core
3582     * @atomicservice
3583     * @since 12
3584     */
3585    HUKS_3DES_KEY_SIZE_128 = 128,
3586    /**
3587     * @syscap SystemCapability.Security.Huks.Core
3588     * @atomicservice
3589     * @since 12
3590     */
3591    HUKS_3DES_KEY_SIZE_192 = 192,
3592  }
3593
3594  /**
3595   * Enum for huks key algorithm.
3596   *
3597   * @enum { number }
3598   * @syscap SystemCapability.Security.Huks.Core
3599   * @since 8
3600   */
3601    /**
3602   * Enum for huks key algorithm.
3603   *
3604   * @enum { number }
3605   * @syscap SystemCapability.Security.Huks.Core
3606   * @atomicservice
3607   * @since 11
3608   */
3609  export enum HuksKeyAlg {
3610    /**
3611     * @syscap SystemCapability.Security.Huks.Extension
3612     * @since 8
3613     */
3614    /**
3615     * @syscap SystemCapability.Security.Huks.Core
3616     * @atomicservice
3617     * @since 12
3618     */
3619    HUKS_ALG_RSA = 1,
3620    /**
3621     * @syscap SystemCapability.Security.Huks.Extension
3622     * @since 8
3623     */
3624    /**
3625     * @syscap SystemCapability.Security.Huks.Core
3626     * @atomicservice
3627     * @since 12
3628     */
3629    HUKS_ALG_ECC = 2,
3630    /**
3631     * @syscap SystemCapability.Security.Huks.Extension
3632     * @since 8
3633     */
3634    /**
3635     * @syscap SystemCapability.Security.Huks.Core
3636     * @atomicservice
3637     * @since 12
3638     */
3639    HUKS_ALG_DSA = 3,
3640
3641    /**
3642     * @syscap SystemCapability.Security.Huks.Core
3643     * @since 8
3644     */
3645    /**
3646     * @syscap SystemCapability.Security.Huks.Core
3647     * @atomicservice
3648     * @since 11
3649     */
3650    HUKS_ALG_AES = 20,
3651    /**
3652     * @syscap SystemCapability.Security.Huks.Extension
3653     * @since 8
3654     */
3655    /**
3656     * @syscap SystemCapability.Security.Huks.Core
3657     * @atomicservice
3658     * @since 12
3659     */
3660    HUKS_ALG_HMAC = 50,
3661    /**
3662     * @syscap SystemCapability.Security.Huks.Extension
3663     * @since 8
3664     */
3665    /**
3666     * @syscap SystemCapability.Security.Huks.Core
3667     * @atomicservice
3668     * @since 12
3669     */
3670    HUKS_ALG_HKDF = 51,
3671    /**
3672     * @syscap SystemCapability.Security.Huks.Extension
3673     * @since 8
3674     */
3675    /**
3676     * @syscap SystemCapability.Security.Huks.Core
3677     * @atomicservice
3678     * @since 12
3679     */
3680    HUKS_ALG_PBKDF2 = 52,
3681
3682    /**
3683     * @syscap SystemCapability.Security.Huks.Extension
3684     * @since 8
3685     */
3686    /**
3687     * @syscap SystemCapability.Security.Huks.Core
3688     * @atomicservice
3689     * @since 12
3690     */
3691    HUKS_ALG_ECDH = 100,
3692    /**
3693     * @syscap SystemCapability.Security.Huks.Extension
3694     * @since 8
3695     */
3696    /**
3697     * @syscap SystemCapability.Security.Huks.Core
3698     * @atomicservice
3699     * @since 12
3700     */
3701    HUKS_ALG_X25519 = 101,
3702    /**
3703     * @syscap SystemCapability.Security.Huks.Extension
3704     * @since 8
3705     */
3706    /**
3707     * @syscap SystemCapability.Security.Huks.Core
3708     * @atomicservice
3709     * @since 12
3710     */
3711    HUKS_ALG_ED25519 = 102,
3712    /**
3713     * @syscap SystemCapability.Security.Huks.Extension
3714     * @since 8
3715     */
3716    /**
3717     * @syscap SystemCapability.Security.Huks.Core
3718     * @atomicservice
3719     * @since 12
3720     */
3721    HUKS_ALG_DH = 103,
3722
3723    /**
3724     * @syscap SystemCapability.Security.Huks.Extension
3725     * @since 9
3726     */
3727    /**
3728     * @syscap SystemCapability.Security.Huks.Core
3729     * @atomicservice
3730     * @since 12
3731     */
3732    HUKS_ALG_SM2 = 150,
3733    /**
3734     * @syscap SystemCapability.Security.Huks.Extension
3735     * @since 9
3736     */
3737    /**
3738     * @syscap SystemCapability.Security.Huks.Core
3739     * @atomicservice
3740     * @since 12
3741     */
3742    HUKS_ALG_SM3 = 151,
3743    /**
3744     * @syscap SystemCapability.Security.Huks.Extension
3745     * @since 9
3746     */
3747    /**
3748     * @syscap SystemCapability.Security.Huks.Core
3749     * @atomicservice
3750     * @since 12
3751     */
3752    HUKS_ALG_SM4 = 152,
3753    /**
3754     * @syscap SystemCapability.Security.Huks.Core
3755     * @atomicservice
3756     * @since 12
3757     */
3758    HUKS_ALG_DES = 160,
3759    /**
3760     * @syscap SystemCapability.Security.Huks.Core
3761     * @atomicservice
3762     * @since 12
3763     */
3764    HUKS_ALG_3DES = 161,
3765    /**
3766     * @syscap SystemCapability.Security.Huks.Core
3767     * @atomicservice
3768     * @since 12
3769     */
3770    HUKS_ALG_CMAC = 162
3771  }
3772
3773  /**
3774   * Enum for huks unwrap suite.
3775   *
3776   * @enum { number }
3777   * @syscap SystemCapability.Security.Huks.Extension
3778   * @since 9
3779   */
3780  /**
3781   * Enum for huks unwrap suite.
3782   *
3783   * @enum { number }
3784   * @syscap SystemCapability.Security.Huks.Core
3785   * @atomicservice
3786   * @since 12
3787   */
3788  export enum HuksUnwrapSuite {
3789    /**
3790     * @syscap SystemCapability.Security.Huks.Extension
3791     * @since 9
3792     */
3793    /**
3794     * @syscap SystemCapability.Security.Huks.Core
3795     * @atomicservice
3796     * @since 12
3797     */
3798    HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING = 1,
3799    /**
3800     * @syscap SystemCapability.Security.Huks.Extension
3801     * @since 9
3802     */
3803    /**
3804     * @syscap SystemCapability.Security.Huks.Core
3805     * @atomicservice
3806     * @since 12
3807     */
3808    HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING = 2
3809  }
3810
3811  /**
3812   * Enum for huks key generate type.
3813   *
3814   * @enum { number }
3815   * @syscap SystemCapability.Security.Huks.Extension
3816   * @since 8
3817   */
3818  /**
3819   * Enum for huks key generate type.
3820   *
3821   * @enum { number }
3822   * @syscap SystemCapability.Security.Huks.Core
3823   * @atomicservice
3824   * @since 12
3825   */
3826  export enum HuksKeyGenerateType {
3827    /**
3828     * @syscap SystemCapability.Security.Huks.Extension
3829     * @since 8
3830     */
3831    /**
3832     * @syscap SystemCapability.Security.Huks.Core
3833     * @atomicservice
3834     * @since 12
3835     */
3836    HUKS_KEY_GENERATE_TYPE_DEFAULT = 0,
3837    /**
3838     * @syscap SystemCapability.Security.Huks.Extension
3839     * @since 8
3840     */
3841    /**
3842     * @syscap SystemCapability.Security.Huks.Core
3843     * @atomicservice
3844     * @since 12
3845     */
3846    HUKS_KEY_GENERATE_TYPE_DERIVE = 1,
3847    /**
3848     * @syscap SystemCapability.Security.Huks.Extension
3849     * @since 8
3850     */
3851    /**
3852     * @syscap SystemCapability.Security.Huks.Core
3853     * @atomicservice
3854     * @since 12
3855     */
3856    HUKS_KEY_GENERATE_TYPE_AGREE = 2
3857  }
3858
3859  /**
3860   * Enum for huks key flag.
3861   *
3862   * @enum { number }
3863   * @syscap SystemCapability.Security.Huks.Core
3864   * @since 8
3865   */
3866  /**
3867   * Enum for huks key flag.
3868   *
3869   * @enum { number }
3870   * @syscap SystemCapability.Security.Huks.Core
3871   * @atomicservice
3872   * @since 12
3873   */
3874  export enum HuksKeyFlag {
3875    /**
3876     * @syscap SystemCapability.Security.Huks.Core
3877     * @since 8
3878     */
3879    /**
3880     * @syscap SystemCapability.Security.Huks.Core
3881     * @atomicservice
3882     * @since 12
3883     */
3884    HUKS_KEY_FLAG_IMPORT_KEY = 1,
3885    /**
3886     * @syscap SystemCapability.Security.Huks.Core
3887     * @since 8
3888     */
3889    /**
3890     * @syscap SystemCapability.Security.Huks.Core
3891     * @atomicservice
3892     * @since 12
3893     */
3894    HUKS_KEY_FLAG_GENERATE_KEY = 2,
3895    /**
3896     * @syscap SystemCapability.Security.Huks.Core
3897     * @since 8
3898     */
3899    /**
3900     * @syscap SystemCapability.Security.Huks.Core
3901     * @atomicservice
3902     * @since 12
3903     */
3904    HUKS_KEY_FLAG_AGREE_KEY = 3,
3905    /**
3906     * @syscap SystemCapability.Security.Huks.Core
3907     * @since 8
3908     */
3909    /**
3910     * @syscap SystemCapability.Security.Huks.Core
3911     * @atomicservice
3912     * @since 12
3913     */
3914    HUKS_KEY_FLAG_DERIVE_KEY = 4
3915  }
3916
3917  /**
3918   * Enum for huks key storage type.
3919   *
3920   * @enum { number }
3921   * @syscap SystemCapability.Security.Huks.Core
3922   * @since 8
3923   */
3924  /**
3925   * Enum for huks key storage type.
3926   *
3927   * @enum { number }
3928   * @syscap SystemCapability.Security.Huks.Core
3929   * @atomicservice
3930   * @since 12
3931   */
3932  export enum HuksKeyStorageType {
3933    /**
3934     * @syscap SystemCapability.Security.Huks.Core
3935     * @since 8
3936     * @deprecated since 10
3937     */
3938    HUKS_STORAGE_TEMP = 0,
3939    /**
3940     * @syscap SystemCapability.Security.Huks.Core
3941     * @since 8
3942     * @deprecated since 10
3943     */
3944    HUKS_STORAGE_PERSISTENT = 1,
3945    /**
3946     * The key is stored and used only in HUKS. It is mutually exclusive with HUKS_STORAGE_KEY_EXPORT_ALLOWED.
3947     *
3948     * @syscap SystemCapability.Security.Huks.Extension
3949     * @since 10
3950     */
3951    /**
3952     * The key is stored and used only in HUKS. It is mutually exclusive with HUKS_STORAGE_KEY_EXPORT_ALLOWED.
3953     *
3954     * @syscap SystemCapability.Security.Huks.Core
3955     * @atomicservice
3956     * @since 12
3957     */
3958    HUKS_STORAGE_ONLY_USED_IN_HUKS = 2,
3959    /**
3960     * The key can be exported. It is mutually exclusive with HUKS_STORAGE_ONLY_USED_IN_HUKS.
3961     *
3962     * @syscap SystemCapability.Security.Huks.Extension
3963     * @since 10
3964     */
3965    /**
3966     * The key can be exported. It is mutually exclusive with HUKS_STORAGE_ONLY_USED_IN_HUKS.
3967     *
3968     * @syscap SystemCapability.Security.Huks.Core
3969     * @atomicservice
3970     * @since 12
3971     */
3972    HUKS_STORAGE_KEY_EXPORT_ALLOWED = 3
3973  }
3974
3975  /**
3976   * Enum for huks import key type.
3977   *
3978   * @enum { number }
3979   * @syscap SystemCapability.Security.Huks.Extension
3980   * @since 9
3981   */
3982  /**
3983   * Enum for huks import key type.
3984   *
3985   * @enum { number }
3986   * @syscap SystemCapability.Security.Huks.Core
3987   * @atomicservice
3988   * @since 12
3989   */
3990  export enum HuksImportKeyType {
3991    /**
3992     * @syscap SystemCapability.Security.Huks.Extension
3993     * @since 9
3994     */
3995    /**
3996     * @syscap SystemCapability.Security.Huks.Core
3997     * @atomicservice
3998     * @since 12
3999     */
4000    HUKS_KEY_TYPE_PUBLIC_KEY = 0,
4001    /**
4002     * @syscap SystemCapability.Security.Huks.Extension
4003     * @since 9
4004     */
4005    /**
4006     * @syscap SystemCapability.Security.Huks.Core
4007     * @atomicservice
4008     * @since 12
4009     */
4010    HUKS_KEY_TYPE_PRIVATE_KEY = 1,
4011    /**
4012     * @syscap SystemCapability.Security.Huks.Extension
4013     * @since 9
4014     */
4015    /**
4016     * @syscap SystemCapability.Security.Huks.Core
4017     * @atomicservice
4018     * @since 12
4019     */
4020    HUKS_KEY_TYPE_KEY_PAIR = 2
4021  }
4022
4023  /**
4024   * Enum for rsa salt len type.
4025   *
4026   * @enum { number }
4027   * @syscap SystemCapability.Security.Huks.Extension
4028   * @since 10
4029   */
4030  /**
4031   * Enum for rsa salt len type.
4032   *
4033   * @enum { number }
4034   * @syscap SystemCapability.Security.Huks.Core
4035   * @atomicservice
4036   * @since 12
4037   */
4038  export enum HuksRsaPssSaltLenType {
4039    /**
4040     * Salt length that matches the digest length.
4041     *
4042     * @syscap SystemCapability.Security.Huks.Extension
4043     * @since 10
4044     */
4045    /**
4046     * Salt length that matches the digest length.
4047     *
4048     * @syscap SystemCapability.Security.Huks.Core
4049     * @atomicservice
4050     * @since 12
4051     */
4052    HUKS_RSA_PSS_SALT_LEN_DIGEST = 0,
4053
4054    /**
4055     * Maximum salt length.
4056     *
4057     * @syscap SystemCapability.Security.Huks.Extension
4058     * @since 10
4059     */
4060    /**
4061     * Maximum salt length.
4062     *
4063     * @syscap SystemCapability.Security.Huks.Core
4064     * @atomicservice
4065     * @since 12
4066     */
4067    HUKS_RSA_PSS_SALT_LEN_MAX = 1
4068  }
4069
4070  /**
4071   * Enum for huks user auth type.
4072   *
4073   * @enum { number }
4074   * @syscap SystemCapability.Security.Huks.Extension
4075   * @since 9
4076   */
4077  /**
4078   * Enum for huks user auth type.
4079   *
4080   * @enum { number }
4081   * @syscap SystemCapability.Security.Huks.Extension
4082   * @atomicservice
4083   * @since 12
4084   */
4085  export enum HuksUserAuthType {
4086    /**
4087     * @syscap SystemCapability.Security.Huks.Extension
4088     * @since 9
4089     */
4090    /**
4091     * @syscap SystemCapability.Security.Huks.Extension
4092     * @atomicservice
4093     * @since 12
4094     */
4095    HUKS_USER_AUTH_TYPE_FINGERPRINT = 1 << 0,
4096    /**
4097     * @syscap SystemCapability.Security.Huks.Extension
4098     * @since 9
4099     */
4100    /**
4101     * @syscap SystemCapability.Security.Huks.Extension
4102     * @atomicservice
4103     * @since 12
4104     */
4105    HUKS_USER_AUTH_TYPE_FACE = 1 << 1,
4106    /**
4107     * @syscap SystemCapability.Security.Huks.Extension
4108     * @since 9
4109     */
4110    /**
4111     * @syscap SystemCapability.Security.Huks.Extension
4112     * @atomicservice
4113     * @since 12
4114     */
4115    HUKS_USER_AUTH_TYPE_PIN = 1 << 2
4116  }
4117
4118  /**
4119   * Enum for huks auth access type.
4120   *
4121   * @enum { number }
4122   * @syscap SystemCapability.Security.Huks.Extension
4123   * @since 9
4124   */
4125  /**
4126   * Enum for huks auth access type.
4127   *
4128   * @enum { number }
4129   * @syscap SystemCapability.Security.Huks.Extension
4130   * @atomicservice
4131   * @since 12
4132   */
4133  export enum HuksAuthAccessType {
4134    /**
4135     * @syscap SystemCapability.Security.Huks.Extension
4136     * @since 9
4137     */
4138    /**
4139     * @syscap SystemCapability.Security.Huks.Extension
4140     * @atomicservice
4141     * @since 12
4142     */
4143    HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD = 1 << 0,
4144    /**
4145     * @syscap SystemCapability.Security.Huks.Extension
4146     * @since 9
4147     */
4148    /**
4149     * @syscap SystemCapability.Security.Huks.Extension
4150     * @atomicservice
4151     * @since 12
4152     */
4153    HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL = 1 << 1,
4154    /**
4155     * Auth type for always valid.
4156     *
4157     * @syscap SystemCapability.Security.Huks.Extension
4158     * @since 11
4159     */
4160    /**
4161     * Auth type for always valid.
4162     *
4163     * @syscap SystemCapability.Security.Huks.Extension
4164     * @atomicservice
4165     * @since 12
4166     */
4167    HUKS_AUTH_ACCESS_ALWAYS_VALID = 1 << 2
4168  }
4169
4170  /**
4171   * Enum for huks user auth mode.
4172   *
4173   * @enum { number }
4174   * @syscap SystemCapability.Security.Huks.Extension
4175   * @atomicservice
4176   * @since 12
4177   */
4178  export enum HuksUserAuthMode {
4179    /**
4180     * Auth mode for local scenarios.
4181     *
4182     * @syscap SystemCapability.Security.Huks.Extension
4183     * @atomicservice
4184     * @since 12
4185     */
4186    HUKS_USER_AUTH_MODE_LOCAL = 0,
4187    /**
4188     * Auth mode for co-auth scenarios.
4189     *
4190     * @syscap SystemCapability.Security.Huks.Extension
4191     * @atomicservice
4192     * @since 12
4193     */
4194    HUKS_USER_AUTH_MODE_COAUTH = 1,
4195  }
4196  /**
4197   * Enum for huks key file storage authentication level.
4198   *
4199   * @enum { number }
4200   * @syscap SystemCapability.Security.Huks.Extension
4201   * @since 11
4202   */
4203    /**
4204   * Enum for huks key file storage authentication level.
4205   *
4206   * @enum { number }
4207   * @syscap SystemCapability.Security.Huks.Core
4208   * @atomicservice
4209   * @since 12
4210   */
4211  export enum HuksAuthStorageLevel {
4212    /**
4213     * Key file storage security level for device encryption standard.
4214     * @syscap SystemCapability.Security.Huks.Extension
4215     * @since 11
4216     */
4217    /**
4218     * Key file storage security level for device encryption standard.
4219     * @syscap SystemCapability.Security.Huks.Core
4220     * @atomicservice
4221     * @since 12
4222     */
4223    HUKS_AUTH_STORAGE_LEVEL_DE = 0,
4224    /**
4225     * Key file storage security level for credential encryption standard.
4226     * @syscap SystemCapability.Security.Huks.Extension
4227     * @since 11
4228     */
4229    /**
4230     * Key file storage security level for credential encryption standard.
4231     * @syscap SystemCapability.Security.Huks.Core
4232     * @atomicservice
4233     * @since 12
4234     */
4235    HUKS_AUTH_STORAGE_LEVEL_CE = 1,
4236    /**
4237     * Key file storage security level for enhanced credential encryption standard.
4238     * @syscap SystemCapability.Security.Huks.Extension
4239     * @since 11
4240     */
4241    /**
4242     * Key file storage security level for enhanced credential encryption standard.
4243     * @syscap SystemCapability.Security.Huks.Core
4244     * @atomicservice
4245     * @since 12
4246     */
4247    HUKS_AUTH_STORAGE_LEVEL_ECE = 2,
4248  }
4249
4250  /**
4251   * Enum for huks auth access challenge type.
4252   *
4253   * @enum { number }
4254   * @syscap SystemCapability.Security.Huks.Extension
4255   * @since 9
4256   */
4257  /**
4258   * Enum for huks auth access challenge type.
4259   *
4260   * @enum { number }
4261   * @syscap SystemCapability.Security.Huks.Extension
4262   * @atomicservice
4263   * @since 12
4264   */
4265  export enum HuksChallengeType {
4266    /**
4267     * @syscap SystemCapability.Security.Huks.Extension
4268     * @since 9
4269     */
4270    /**
4271     * @syscap SystemCapability.Security.Huks.Extension
4272     * @atomicservice
4273     * @since 12
4274     */
4275    HUKS_CHALLENGE_TYPE_NORMAL = 0,
4276    /**
4277     * @syscap SystemCapability.Security.Huks.Extension
4278     * @since 9
4279     */
4280    /**
4281     * @syscap SystemCapability.Security.Huks.Extension
4282     * @atomicservice
4283     * @since 12
4284     */
4285    HUKS_CHALLENGE_TYPE_CUSTOM = 1,
4286    /**
4287     * @syscap SystemCapability.Security.Huks.Extension
4288     * @since 9
4289     */
4290    /**
4291     * @syscap SystemCapability.Security.Huks.Extension
4292     * @atomicservice
4293     * @since 12
4294     */
4295    HUKS_CHALLENGE_TYPE_NONE = 2
4296  }
4297
4298  /**
4299   * Enum for huks challenge position.
4300   *
4301   * @enum { number }
4302   * @syscap SystemCapability.Security.Huks.Extension
4303   * @since 9
4304   */
4305  /**
4306   * Enum for huks challenge position.
4307   *
4308   * @enum { number }
4309   * @syscap SystemCapability.Security.Huks.Extension
4310   * @atomicservice
4311   * @since 12
4312   */
4313  export enum HuksChallengePosition {
4314    /**
4315     * @syscap SystemCapability.Security.Huks.Extension
4316     * @since 9
4317     */
4318    /**
4319     * @syscap SystemCapability.Security.Huks.Extension
4320     * @atomicservice
4321     * @since 12
4322     */
4323    HUKS_CHALLENGE_POS_0 = 0,
4324    /**
4325     * @syscap SystemCapability.Security.Huks.Extension
4326     * @since 9
4327     */
4328    /**
4329     * @syscap SystemCapability.Security.Huks.Extension
4330     * @atomicservice
4331     * @since 12
4332     */
4333    HUKS_CHALLENGE_POS_1,
4334    /**
4335     * @syscap SystemCapability.Security.Huks.Extension
4336     * @since 9
4337     */
4338    /**
4339     * @syscap SystemCapability.Security.Huks.Extension
4340     * @atomicservice
4341     * @since 12
4342     */
4343    HUKS_CHALLENGE_POS_2,
4344    /**
4345     * @syscap SystemCapability.Security.Huks.Extension
4346     * @since 9
4347     */
4348    /**
4349     * @syscap SystemCapability.Security.Huks.Extension
4350     * @atomicservice
4351     * @since 12
4352     */
4353    HUKS_CHALLENGE_POS_3
4354  }
4355
4356  /**
4357   * Enum for huks secure sign type.
4358   *
4359   * @enum { number }
4360   * @syscap SystemCapability.Security.Huks.Extension
4361   * @since 9
4362   */
4363  /**
4364   * Enum for huks secure sign type.
4365   *
4366   * @enum { number }
4367   * @syscap SystemCapability.Security.Huks.Extension
4368   * @atomicservice
4369   * @since 12
4370   */
4371  export enum HuksSecureSignType {
4372    /**
4373     * @syscap SystemCapability.Security.Huks.Extension
4374     * @since 9
4375     */
4376    /**
4377     * @syscap SystemCapability.Security.Huks.Extension
4378     * @atomicservice
4379     * @since 12
4380     */
4381    HUKS_SECURE_SIGN_WITH_AUTHINFO = 1
4382  }
4383
4384  /**
4385   * Enum for huks ipc send type.
4386   *
4387   * @enum { number }
4388   * @syscap SystemCapability.Security.Huks.Extension
4389   * @since 8
4390   */
4391  /**
4392   * Enum for huks ipc send type.
4393   *
4394   * @enum { number }
4395   * @syscap SystemCapability.Security.Huks.Core
4396   * @atomicservice
4397   * @since 12
4398   */
4399  export enum HuksSendType {
4400    /**
4401     * @syscap SystemCapability.Security.Huks.Extension
4402     * @since 8
4403     */
4404    /**
4405     * @syscap SystemCapability.Security.Huks.Core
4406     * @atomicservice
4407     * @since 12
4408     */
4409    HUKS_SEND_TYPE_ASYNC = 0,
4410    /**
4411     * @syscap SystemCapability.Security.Huks.Extension
4412     * @since 8
4413     */
4414    /**
4415     * @syscap SystemCapability.Security.Huks.Core
4416     * @atomicservice
4417     * @since 12
4418     */
4419    HUKS_SEND_TYPE_SYNC = 1
4420  }
4421
4422  /**
4423   * Enum for huks base tag type.
4424   *
4425   * @enum { number }
4426   * @syscap SystemCapability.Security.Huks.Core
4427   * @since 8
4428   */
4429  /**
4430   * Enum for huks base tag type.
4431   *
4432   * @enum { number }
4433   * @syscap SystemCapability.Security.Huks.Core
4434   * @atomicservice
4435   * @since 11
4436   */
4437  export enum HuksTagType {
4438    /**
4439     * @syscap SystemCapability.Security.Huks.Core
4440     * @since 8
4441     */
4442    /**
4443     * @syscap SystemCapability.Security.Huks.Core
4444     * @atomicservice
4445     * @since 11
4446     */
4447    HUKS_TAG_TYPE_INVALID = 0 << 28,
4448    /**
4449     * @syscap SystemCapability.Security.Huks.Core
4450     * @since 8
4451     */
4452    /**
4453     * @syscap SystemCapability.Security.Huks.Core
4454     * @atomicservice
4455     * @since 11
4456     */
4457    HUKS_TAG_TYPE_INT = 1 << 28,
4458    /**
4459     * @syscap SystemCapability.Security.Huks.Core
4460     * @since 8
4461     */
4462    /**
4463     * @syscap SystemCapability.Security.Huks.Core
4464     * @atomicservice
4465     * @since 11
4466     */
4467    HUKS_TAG_TYPE_UINT = 2 << 28,
4468    /**
4469     * @syscap SystemCapability.Security.Huks.Core
4470     * @since 8
4471     */
4472    /**
4473     * @syscap SystemCapability.Security.Huks.Core
4474     * @atomicservice
4475     * @since 11
4476     */
4477    HUKS_TAG_TYPE_ULONG = 3 << 28,
4478    /**
4479     * @syscap SystemCapability.Security.Huks.Core
4480     * @since 8
4481     */
4482    /**
4483     * @syscap SystemCapability.Security.Huks.Core
4484     * @atomicservice
4485     * @since 11
4486     */
4487    HUKS_TAG_TYPE_BOOL = 4 << 28,
4488    /**
4489     * @syscap SystemCapability.Security.Huks.Core
4490     * @since 8
4491     */
4492    /**
4493     * @syscap SystemCapability.Security.Huks.Core
4494     * @atomicservice
4495     * @since 11
4496     */
4497    HUKS_TAG_TYPE_BYTES = 5 << 28
4498  }
4499
4500  /**
4501   * Enum for huks tag.
4502   *
4503   * @enum { number }
4504   * @syscap SystemCapability.Security.Huks.Core
4505   * @since 8
4506   */
4507  /**
4508   * Enum for huks tag.
4509   *
4510   * @enum { number }
4511   * @syscap SystemCapability.Security.Huks.Core
4512   * @atomicservice
4513   * @since 11
4514   */
4515  export enum HuksTag {
4516    /**
4517     * Invalid TAG
4518     *
4519     * @syscap SystemCapability.Security.Huks.Core
4520     * @since 8
4521     * @deprecated since 9
4522     */
4523    HUKS_TAG_INVALID = HuksTagType.HUKS_TAG_TYPE_INVALID | 0,
4524
4525    /* Base algorithm TAG: 1 - 200 */
4526    /**
4527     * @syscap SystemCapability.Security.Huks.Core
4528     * @since 8
4529     */
4530    /**
4531     * @syscap SystemCapability.Security.Huks.Core
4532     * @atomicservice
4533     * @since 11
4534     */
4535    HUKS_TAG_ALGORITHM = HuksTagType.HUKS_TAG_TYPE_UINT | 1,
4536    /**
4537     * @syscap SystemCapability.Security.Huks.Core
4538     * @since 8
4539     */
4540    /**
4541     * @syscap SystemCapability.Security.Huks.Core
4542     * @atomicservice
4543     * @since 11
4544     */
4545    HUKS_TAG_PURPOSE = HuksTagType.HUKS_TAG_TYPE_UINT | 2,
4546    /**
4547     * @syscap SystemCapability.Security.Huks.Core
4548     * @since 8
4549     */
4550    /**
4551     * @syscap SystemCapability.Security.Huks.Core
4552     * @atomicservice
4553     * @since 11
4554     */
4555    HUKS_TAG_KEY_SIZE = HuksTagType.HUKS_TAG_TYPE_UINT | 3,
4556
4557    /**
4558     * @syscap SystemCapability.Security.Huks.Extension
4559     * @since 8
4560     */
4561    /**
4562     * @syscap SystemCapability.Security.Huks.Core
4563     * @atomicservice
4564     * @since 12
4565     */
4566    HUKS_TAG_DIGEST = HuksTagType.HUKS_TAG_TYPE_UINT | 4,
4567    /**
4568     * @syscap SystemCapability.Security.Huks.Core
4569     * @since 8
4570     */
4571    /**
4572     * @syscap SystemCapability.Security.Huks.Core
4573     * @atomicservice
4574     * @since 11
4575     */
4576    HUKS_TAG_PADDING = HuksTagType.HUKS_TAG_TYPE_UINT | 5,
4577    /**
4578     * @syscap SystemCapability.Security.Huks.Core
4579     * @since 8
4580     */
4581    /**
4582     * @syscap SystemCapability.Security.Huks.Core
4583     * @atomicservice
4584     * @since 11
4585     */
4586    HUKS_TAG_BLOCK_MODE = HuksTagType.HUKS_TAG_TYPE_UINT | 6,
4587    /**
4588     * @syscap SystemCapability.Security.Huks.Core
4589     * @since 8
4590     */
4591    /**
4592     * @syscap SystemCapability.Security.Huks.Core
4593     * @atomicservice
4594     * @since 12
4595     */
4596    HUKS_TAG_KEY_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 7,
4597    /**
4598     * @syscap SystemCapability.Security.Huks.Core
4599     * @since 8
4600     */
4601    /**
4602     * @syscap SystemCapability.Security.Huks.Core
4603     * @atomicservice
4604     * @since 11
4605     */
4606    HUKS_TAG_ASSOCIATED_DATA = HuksTagType.HUKS_TAG_TYPE_BYTES | 8,
4607
4608    /**
4609     * @syscap SystemCapability.Security.Huks.Core
4610     * @since 8
4611     */
4612    /**
4613     * @syscap SystemCapability.Security.Huks.Core
4614     * @atomicservice
4615     * @since 11
4616     */
4617    HUKS_TAG_NONCE = HuksTagType.HUKS_TAG_TYPE_BYTES | 9,
4618    /**
4619     * @syscap SystemCapability.Security.Huks.Core
4620     * @since 8
4621     */
4622    /**
4623     * @syscap SystemCapability.Security.Huks.Core
4624     * @atomicservice
4625     * @since 12
4626     */
4627    HUKS_TAG_IV = HuksTagType.HUKS_TAG_TYPE_BYTES | 10,
4628
4629    /**
4630     * Key derivation TAG.
4631     *
4632     * @syscap SystemCapability.Security.Huks.Core
4633     * @since 8
4634     */
4635    /**
4636     * Key derivation TAG.
4637     *
4638     * @syscap SystemCapability.Security.Huks.Core
4639     * @atomicservice
4640     * @since 12
4641     */
4642    HUKS_TAG_INFO = HuksTagType.HUKS_TAG_TYPE_BYTES | 11,
4643    /**
4644     * @syscap SystemCapability.Security.Huks.Extension
4645     * @since 8
4646     */
4647    /**
4648     * @syscap SystemCapability.Security.Huks.Core
4649     * @atomicservice
4650     * @since 12
4651     */
4652    HUKS_TAG_SALT = HuksTagType.HUKS_TAG_TYPE_BYTES | 12,
4653    /**
4654     * @syscap SystemCapability.Security.Huks.Core
4655     * @since 8
4656     * @deprecated since 9
4657     */
4658    HUKS_TAG_PWD = HuksTagType.HUKS_TAG_TYPE_BYTES | 13,
4659    /**
4660     * @syscap SystemCapability.Security.Huks.Extension
4661     * @since 8
4662     */
4663    /**
4664     * @syscap SystemCapability.Security.Huks.Core
4665     * @atomicservice
4666     * @since 12
4667     */
4668    HUKS_TAG_ITERATION = HuksTagType.HUKS_TAG_TYPE_UINT | 14,
4669
4670    /**
4671     * choose from enum HuksKeyGenerateType.
4672     *
4673     * @syscap SystemCapability.Security.Huks.Core
4674     * @since 8
4675     */
4676    /**
4677     * choose from enum HuksKeyGenerateType.
4678     *
4679     * @syscap SystemCapability.Security.Huks.Core
4680     * @atomicservice
4681     * @since 12
4682     */
4683    HUKS_TAG_KEY_GENERATE_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 15,
4684
4685    /**
4686     * @syscap SystemCapability.Security.Huks.Extension
4687     * @since 8
4688     * @deprecated since 9
4689     */
4690    HUKS_TAG_DERIVE_MAIN_KEY = HuksTagType.HUKS_TAG_TYPE_BYTES | 16,
4691    /**
4692     * @syscap SystemCapability.Security.Huks.Extension
4693     * @since 8
4694     * @deprecated since 9
4695     */
4696    HUKS_TAG_DERIVE_FACTOR = HuksTagType.HUKS_TAG_TYPE_BYTES | 17,
4697    /**
4698     * @syscap SystemCapability.Security.Huks.Extension
4699     * @since 8
4700     * @deprecated since 9
4701     */
4702    HUKS_TAG_DERIVE_ALG = HuksTagType.HUKS_TAG_TYPE_UINT | 18,
4703    /**
4704     * @syscap SystemCapability.Security.Huks.Extension
4705     * @since 8
4706     */
4707    /**
4708     * @syscap SystemCapability.Security.Huks.Core
4709     * @atomicservice
4710     * @since 12
4711     */
4712    HUKS_TAG_AGREE_ALG = HuksTagType.HUKS_TAG_TYPE_UINT | 19,
4713    /**
4714     * @syscap SystemCapability.Security.Huks.Extension
4715     * @since 8
4716     */
4717    /**
4718     * @syscap SystemCapability.Security.Huks.Core
4719     * @atomicservice
4720     * @since 12
4721     */
4722    HUKS_TAG_AGREE_PUBLIC_KEY_IS_KEY_ALIAS = HuksTagType.HUKS_TAG_TYPE_BOOL | 20,
4723    /**
4724     * @syscap SystemCapability.Security.Huks.Extension
4725     * @since 8
4726     */
4727    /**
4728     * @syscap SystemCapability.Security.Huks.Core
4729     * @atomicservice
4730     * @since 12
4731     */
4732    HUKS_TAG_AGREE_PRIVATE_KEY_ALIAS = HuksTagType.HUKS_TAG_TYPE_BYTES | 21,
4733    /**
4734     * @syscap SystemCapability.Security.Huks.Extension
4735     * @since 8
4736     */
4737    /**
4738     * @syscap SystemCapability.Security.Huks.Core
4739     * @atomicservice
4740     * @since 12
4741     */
4742    HUKS_TAG_AGREE_PUBLIC_KEY = HuksTagType.HUKS_TAG_TYPE_BYTES | 22,
4743    /**
4744     * @syscap SystemCapability.Security.Huks.Core
4745     * @since 8
4746     */
4747    /**
4748     * @syscap SystemCapability.Security.Huks.Core
4749     * @atomicservice
4750     * @since 11
4751     */
4752    HUKS_TAG_KEY_ALIAS = HuksTagType.HUKS_TAG_TYPE_BYTES | 23,
4753    /**
4754     * @syscap SystemCapability.Security.Huks.Extension
4755     * @since 8
4756     */
4757    /**
4758     * @syscap SystemCapability.Security.Huks.Core
4759     * @atomicservice
4760     * @since 12
4761     */
4762    HUKS_TAG_DERIVE_KEY_SIZE = HuksTagType.HUKS_TAG_TYPE_UINT | 24,
4763
4764    /**
4765     * Choose from enum HuksImportKeyType
4766     *
4767     * @syscap SystemCapability.Security.Huks.Extension
4768     * @since 9
4769     */
4770    /**
4771     * Choose from enum HuksImportKeyType
4772     *
4773     * @syscap SystemCapability.Security.Huks.Core
4774     * @atomicservice
4775     * @since 12
4776     */
4777    HUKS_TAG_IMPORT_KEY_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 25,
4778
4779    /**
4780     * @syscap SystemCapability.Security.Huks.Extension
4781     * @since 9
4782     */
4783    /**
4784     * @syscap SystemCapability.Security.Huks.Core
4785     * @atomicservice
4786     * @since 12
4787     */
4788    HUKS_TAG_UNWRAP_ALGORITHM_SUITE = HuksTagType.HUKS_TAG_TYPE_UINT | 26,
4789
4790    /**
4791     * Key storage type, which can be HUKS_STORAGE_ONLY_USED_IN_HUKS or HUKS_STORAGE_KEY_EXPORT_ALLOWED.
4792     *
4793     * @syscap SystemCapability.Security.Huks.Extension
4794     * @since 10
4795     */
4796    /**
4797     * Key storage type, which can be HUKS_STORAGE_ONLY_USED_IN_HUKS or HUKS_STORAGE_KEY_EXPORT_ALLOWED.
4798     *
4799     * @syscap SystemCapability.Security.Huks.Core
4800     * @atomicservice
4801     * @since 12
4802     */
4803    HUKS_TAG_DERIVED_AGREED_KEY_STORAGE_FLAG = HuksTagType.HUKS_TAG_TYPE_UINT | 29,
4804
4805    /**
4806     * RSA salt length type. For details, see HuksRsaPssSaltLenType.
4807     *
4808     * @syscap SystemCapability.Security.Huks.Extension
4809     * @since 10
4810     */
4811    /**
4812     * RSA salt length type. For details, see HuksRsaPssSaltLenType.
4813     *
4814     * @syscap SystemCapability.Security.Huks.Core
4815     * @atomicservice
4816     * @since 12
4817     */
4818    HUKS_TAG_RSA_PSS_SALT_LEN_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 30,
4819
4820    /*
4821     * Key authentication related TAG: 201 - 300
4822     *
4823     * Start of validity
4824     */
4825    /**
4826     * @syscap SystemCapability.Security.Huks.Extension
4827     * @since 8
4828     * @deprecated since 9
4829     */
4830    HUKS_TAG_ACTIVE_DATETIME = HuksTagType.HUKS_TAG_TYPE_ULONG | 201,
4831    /**
4832     * Date when new "messages" should not be created.
4833     *
4834     * @syscap SystemCapability.Security.Huks.Core
4835     * @since 8
4836     * @deprecated since 9
4837     */
4838    HUKS_TAG_ORIGINATION_EXPIRE_DATETIME = HuksTagType.HUKS_TAG_TYPE_ULONG | 202,
4839    /**
4840     * Date when existing "messages" should not be used.
4841     *
4842     * @syscap SystemCapability.Security.Huks.Core
4843     * @since 8
4844     * @deprecated since 9
4845     */
4846    HUKS_TAG_USAGE_EXPIRE_DATETIME = HuksTagType.HUKS_TAG_TYPE_ULONG | 203,
4847    /**
4848     * Key creation time.
4849     *
4850     * @syscap SystemCapability.Security.Huks.Core
4851     * @since 8
4852     * @deprecated since 9
4853     */
4854    HUKS_TAG_CREATION_DATETIME = HuksTagType.HUKS_TAG_TYPE_ULONG | 204,
4855
4856    /* Other authentication related TAG: 301 - 500 */
4857    /**
4858     * @syscap SystemCapability.Security.Huks.Extension
4859     * @since 8
4860     */
4861    /**
4862     * @syscap SystemCapability.Security.Huks.Core
4863     * @atomicservice
4864     * @since 12
4865     */
4866    HUKS_TAG_ALL_USERS = HuksTagType.HUKS_TAG_TYPE_BOOL | 301,
4867    /**
4868     * @syscap SystemCapability.Security.Huks.Extension
4869     * @since 8
4870     */
4871    /**
4872     * @syscap SystemCapability.Security.Huks.Core
4873     * @atomicservice
4874     * @since 12
4875     */
4876    HUKS_TAG_USER_ID = HuksTagType.HUKS_TAG_TYPE_UINT | 302,
4877    /**
4878     * @syscap SystemCapability.Security.Huks.Extension
4879     * @since 8
4880     */
4881    /**
4882     * @syscap SystemCapability.Security.Huks.Core
4883     * @atomicservice
4884     * @since 12
4885     */
4886    HUKS_TAG_NO_AUTH_REQUIRED = HuksTagType.HUKS_TAG_TYPE_BOOL | 303,
4887    /**
4888     * @syscap SystemCapability.Security.Huks.Extension
4889     * @since 8
4890     */
4891    /**
4892     * @syscap SystemCapability.Security.Huks.Extension
4893     * @atomicservice
4894     * @since 12
4895     */
4896    HUKS_TAG_USER_AUTH_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 304,
4897    /**
4898     * @syscap SystemCapability.Security.Huks.Extension
4899     * @since 8
4900     */
4901    /**
4902     * @syscap SystemCapability.Security.Huks.Extension
4903     * @atomicservice
4904     * @since 12
4905     */
4906    HUKS_TAG_AUTH_TIMEOUT = HuksTagType.HUKS_TAG_TYPE_UINT | 305,
4907    /**
4908     * @syscap SystemCapability.Security.Huks.Extension
4909     * @since 8
4910     */
4911    /**
4912     * @syscap SystemCapability.Security.Huks.Extension
4913     * @atomicservice
4914     * @since 12
4915     */
4916    HUKS_TAG_AUTH_TOKEN = HuksTagType.HUKS_TAG_TYPE_BYTES | 306,
4917
4918    /* Key secure access control and user auth TAG */
4919    /**
4920     * @syscap SystemCapability.Security.Huks.Extension
4921     * @since 9
4922     */
4923    /**
4924     * @syscap SystemCapability.Security.Huks.Extension
4925     * @atomicservice
4926     * @since 12
4927     */
4928    HUKS_TAG_KEY_AUTH_ACCESS_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 307,
4929
4930    /**
4931     * @syscap SystemCapability.Security.Huks.Extension
4932     * @since 9
4933     */
4934    /**
4935     * @syscap SystemCapability.Security.Huks.Extension
4936     * @atomicservice
4937     * @since 12
4938     */
4939    HUKS_TAG_KEY_SECURE_SIGN_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 308,
4940
4941    /**
4942     * @syscap SystemCapability.Security.Huks.Extension
4943     * @since 9
4944     */
4945    /**
4946     * @syscap SystemCapability.Security.Huks.Extension
4947     * @atomicservice
4948     * @since 12
4949     */
4950    HUKS_TAG_CHALLENGE_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 309,
4951
4952    /**
4953     * @syscap SystemCapability.Security.Huks.Extension
4954     * @since 9
4955     */
4956    /**
4957     * @syscap SystemCapability.Security.Huks.Extension
4958     * @atomicservice
4959     * @since 12
4960     */
4961    HUKS_TAG_CHALLENGE_POS = HuksTagType.HUKS_TAG_TYPE_UINT | 310,
4962
4963    /**
4964     * Supported key secure access control purpose tag, the value from enum HuksKeyPurpose.
4965     *
4966     * @syscap SystemCapability.Security.Huks.Extension
4967     * @since 10
4968     */
4969    /**
4970     * Supported key secure access control purpose tag, the value from enum HuksKeyPurpose.
4971     *
4972     * @syscap SystemCapability.Security.Huks.Extension
4973     * @atomicservice
4974     * @since 12
4975     */
4976    HUKS_TAG_KEY_AUTH_PURPOSE = HuksTagType.HUKS_TAG_TYPE_UINT | 311,
4977
4978    /**
4979     * Security level of access control for key file storage, whose optional values are from enum HuksAuthStorageLevel.
4980     *
4981     * @syscap SystemCapability.Security.Huks.Extension
4982     * @since 11
4983     */
4984    /**
4985     * Security level of access control for key file storage, whose optional values are from enum HuksAuthStorageLevel.
4986     *
4987     * @syscap SystemCapability.Security.Huks.Extension
4988     * @atomicservice
4989     * @since 12
4990     */
4991    HUKS_TAG_AUTH_STORAGE_LEVEL = HuksTagType.HUKS_TAG_TYPE_UINT | 316,
4992
4993    /**
4994     * Authentication mode of the user authtoken, whose optional values are from enum HuksUserAuthMode.
4995     * @syscap SystemCapability.Security.Huks.Extension
4996     * @atomicservice
4997     * @since 12
4998     */
4999    HUKS_TAG_USER_AUTH_MODE = HuksTagType.HUKS_TAG_TYPE_UINT | 319,
5000
5001    /* Attestation related TAG: 501 - 600 */
5002    /**
5003     * @syscap SystemCapability.Security.Huks.Extension
5004     * @since 8
5005     */
5006    /**
5007     * @syscap SystemCapability.Security.Huks.Extension
5008     * @atomicservice
5009     * @since 12
5010     */
5011    HUKS_TAG_ATTESTATION_CHALLENGE = HuksTagType.HUKS_TAG_TYPE_BYTES | 501,
5012    /**
5013     * @syscap SystemCapability.Security.Huks.Extension
5014     * @since 8
5015     */
5016    /**
5017     * @syscap SystemCapability.Security.Huks.Extension
5018     * @atomicservice
5019     * @since 12
5020     */
5021    HUKS_TAG_ATTESTATION_APPLICATION_ID = HuksTagType.HUKS_TAG_TYPE_BYTES | 502,
5022    /**
5023     * @syscap SystemCapability.Security.Huks.Extension
5024     * @since 8
5025     * @deprecated since 9
5026     */
5027    HUKS_TAG_ATTESTATION_ID_BRAND = HuksTagType.HUKS_TAG_TYPE_BYTES | 503,
5028    /**
5029     * @syscap SystemCapability.Security.Huks.Extension
5030     * @since 8
5031     * @deprecated since 9
5032     */
5033    HUKS_TAG_ATTESTATION_ID_DEVICE = HuksTagType.HUKS_TAG_TYPE_BYTES | 504,
5034    /**
5035     * @syscap SystemCapability.Security.Huks.Extension
5036     * @since 8
5037     * @deprecated since 9
5038     */
5039    HUKS_TAG_ATTESTATION_ID_PRODUCT = HuksTagType.HUKS_TAG_TYPE_BYTES | 505,
5040    /**
5041     * @syscap SystemCapability.Security.Huks.Extension
5042     * @since 8
5043     * @deprecated since 9
5044     */
5045    HUKS_TAG_ATTESTATION_ID_SERIAL = HuksTagType.HUKS_TAG_TYPE_BYTES | 506,
5046    /**
5047     * @syscap SystemCapability.Security.Huks.Extension
5048     * @since 8
5049     * @deprecated since 9
5050     */
5051    HUKS_TAG_ATTESTATION_ID_IMEI = HuksTagType.HUKS_TAG_TYPE_BYTES | 507,
5052    /**
5053     * @syscap SystemCapability.Security.Huks.Extension
5054     * @since 8
5055     * @deprecated since 9
5056     */
5057    HUKS_TAG_ATTESTATION_ID_MEID = HuksTagType.HUKS_TAG_TYPE_BYTES | 508,
5058    /**
5059     * @syscap SystemCapability.Security.Huks.Extension
5060     * @since 8
5061     * @deprecated since 9
5062     */
5063    HUKS_TAG_ATTESTATION_ID_MANUFACTURER = HuksTagType.HUKS_TAG_TYPE_BYTES | 509,
5064    /**
5065     * @syscap SystemCapability.Security.Huks.Extension
5066     * @since 8
5067     * @deprecated since 9
5068     */
5069    HUKS_TAG_ATTESTATION_ID_MODEL = HuksTagType.HUKS_TAG_TYPE_BYTES | 510,
5070    /**
5071     * @syscap SystemCapability.Security.Huks.Extension
5072     * @since 8
5073     */
5074    /**
5075     * @syscap SystemCapability.Security.Huks.Extension
5076     * @atomicservice
5077     * @since 12
5078     */
5079    HUKS_TAG_ATTESTATION_ID_ALIAS = HuksTagType.HUKS_TAG_TYPE_BYTES | 511,
5080    /**
5081     * @syscap SystemCapability.Security.Huks.Extension
5082     * @since 8
5083     * @deprecated since 9
5084     */
5085    HUKS_TAG_ATTESTATION_ID_SOCID = HuksTagType.HUKS_TAG_TYPE_BYTES | 512,
5086    /**
5087     * @syscap SystemCapability.Security.Huks.Extension
5088     * @since 8
5089     * @deprecated since 9
5090     */
5091    HUKS_TAG_ATTESTATION_ID_UDID = HuksTagType.HUKS_TAG_TYPE_BYTES | 513,
5092    /**
5093     * @syscap SystemCapability.Security.Huks.Extension
5094     * @since 8
5095     */
5096    /**
5097     * @syscap SystemCapability.Security.Huks.Extension
5098     * @atomicservice
5099     * @since 12
5100     */
5101    HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO = HuksTagType.HUKS_TAG_TYPE_BYTES | 514,
5102    /**
5103     * @syscap SystemCapability.Security.Huks.Extension
5104     * @since 8
5105     */
5106    /**
5107     * @syscap SystemCapability.Security.Huks.Extension
5108     * @atomicservice
5109     * @since 12
5110     */
5111    HUKS_TAG_ATTESTATION_ID_VERSION_INFO = HuksTagType.HUKS_TAG_TYPE_BYTES | 515,
5112
5113    /*
5114     * Other reserved TAG: 601 - 1000
5115     *
5116     * Extension TAG: 1001 - 9999
5117     */
5118
5119    /**
5120     * @syscap SystemCapability.Security.Huks.Core
5121     * @since 8
5122     */
5123    /**
5124     * @syscap SystemCapability.Security.Huks.Core
5125     * @atomicservice
5126     * @since 12
5127     */
5128    HUKS_TAG_IS_KEY_ALIAS = HuksTagType.HUKS_TAG_TYPE_BOOL | 1001,
5129    /**
5130     * choose from enum HuksKeyStorageType.
5131     *
5132     * @syscap SystemCapability.Security.Huks.Core
5133     * @since 8
5134     */
5135    /**
5136     * choose from enum HuksKeyStorageType.
5137     *
5138     * @syscap SystemCapability.Security.Huks.Core
5139     * @atomicservice
5140     * @since 12
5141     */
5142    HUKS_TAG_KEY_STORAGE_FLAG = HuksTagType.HUKS_TAG_TYPE_UINT | 1002,
5143    /**
5144     * @syscap SystemCapability.Security.Huks.Extension
5145     * @since 8
5146     */
5147    /**
5148     * @syscap SystemCapability.Security.Huks.Core
5149     * @atomicservice
5150     * @since 12
5151     */
5152    HUKS_TAG_IS_ALLOWED_WRAP = HuksTagType.HUKS_TAG_TYPE_BOOL | 1003,
5153    /**
5154     * @syscap SystemCapability.Security.Huks.Extension
5155     * @since 8
5156     */
5157    /**
5158     * @syscap SystemCapability.Security.Huks.Core
5159     * @atomicservice
5160     * @since 12
5161     */
5162    HUKS_TAG_KEY_WRAP_TYPE = HuksTagType.HUKS_TAG_TYPE_UINT | 1004,
5163    /**
5164     * @syscap SystemCapability.Security.Huks.Extension
5165     * @since 8
5166     */
5167    /**
5168     * @syscap SystemCapability.Security.Huks.Extension
5169     * @atomicservice
5170     * @since 12
5171     */
5172    HUKS_TAG_KEY_AUTH_ID = HuksTagType.HUKS_TAG_TYPE_BYTES | 1005,
5173    /**
5174     * @syscap SystemCapability.Security.Huks.Extension
5175     * @since 8
5176     */
5177    /**
5178     * @syscap SystemCapability.Security.Huks.Core
5179     * @atomicservice
5180     * @since 12
5181     */
5182    HUKS_TAG_KEY_ROLE = HuksTagType.HUKS_TAG_TYPE_UINT | 1006,
5183    /**
5184     * choose from enum HuksKeyFlag.
5185     *
5186     * @syscap SystemCapability.Security.Huks.Core
5187     * @since 8
5188     */
5189    /**
5190     * choose from enum HuksKeyFlag.
5191     *
5192     * @syscap SystemCapability.Security.Huks.Core
5193     * @atomicservice
5194     * @since 12
5195     */
5196    HUKS_TAG_KEY_FLAG = HuksTagType.HUKS_TAG_TYPE_UINT | 1007,
5197    /**
5198     * @syscap SystemCapability.Security.Huks.Extension
5199     * @since 8
5200     */
5201    /**
5202     * @syscap SystemCapability.Security.Huks.Core
5203     * @atomicservice
5204     * @since 12
5205     */
5206    HUKS_TAG_IS_ASYNCHRONIZED = HuksTagType.HUKS_TAG_TYPE_UINT | 1008,
5207    /**
5208     * @syscap SystemCapability.Security.Huks.Core
5209     * @since 8
5210     * @deprecated since 9
5211     */
5212    HUKS_TAG_SECURE_KEY_ALIAS = HuksTagType.HUKS_TAG_TYPE_BOOL | 1009,
5213    /**
5214     * @syscap SystemCapability.Security.Huks.Extension
5215     * @since 8
5216     * @deprecated since 9
5217     */
5218    HUKS_TAG_SECURE_KEY_UUID = HuksTagType.HUKS_TAG_TYPE_BYTES | 1010,
5219    /**
5220     * @syscap SystemCapability.Security.Huks.Core
5221     * @since 8
5222     */
5223    /**
5224     * @syscap SystemCapability.Security.Huks.Core
5225     * @atomicservice
5226     * @since 12
5227     */
5228    HUKS_TAG_KEY_DOMAIN = HuksTagType.HUKS_TAG_TYPE_UINT | 1011,
5229
5230    /**
5231     * Key access control based on device password setting status. True means the key can only be generated and used when the password is set.
5232     *
5233     * @syscap SystemCapability.Security.Huks.Extension
5234     * @since 11
5235     */
5236    /**
5237     * Key access control based on device password setting status. True means the key can only be generated and used when the password is set.
5238     *
5239     * @syscap SystemCapability.Security.Huks.Extension
5240     * @atomicservice
5241     * @since 12
5242     */
5243    HUKS_TAG_IS_DEVICE_PASSWORD_SET = HuksTagType.HUKS_TAG_TYPE_BOOL | 1012,
5244
5245    /* Inner-use TAG: 10001 - 10999 */
5246
5247    /**
5248     * @syscap SystemCapability.Security.Huks.Core
5249     * @since 8
5250     * @deprecated since 9
5251     */
5252    HUKS_TAG_PROCESS_NAME = HuksTagType.HUKS_TAG_TYPE_BYTES | 10001,
5253    /**
5254     * @syscap SystemCapability.Security.Huks.Extension
5255     * @since 8
5256     * @deprecated since 9
5257     */
5258    HUKS_TAG_PACKAGE_NAME = HuksTagType.HUKS_TAG_TYPE_BYTES | 10002,
5259    /**
5260     * @syscap SystemCapability.Security.Huks.Extension
5261     * @since 8
5262     * @deprecated since 9
5263     */
5264    HUKS_TAG_ACCESS_TIME = HuksTagType.HUKS_TAG_TYPE_UINT | 10003,
5265    /**
5266     * @syscap SystemCapability.Security.Huks.Extension
5267     * @since 8
5268     * @deprecated since 9
5269     */
5270    HUKS_TAG_USES_TIME = HuksTagType.HUKS_TAG_TYPE_UINT | 10004,
5271    /**
5272     * @syscap SystemCapability.Security.Huks.Extension
5273     * @since 8
5274     * @deprecated since 9
5275     */
5276    HUKS_TAG_CRYPTO_CTX = HuksTagType.HUKS_TAG_TYPE_ULONG | 10005,
5277    /**
5278     * @syscap SystemCapability.Security.Huks.Core
5279     * @since 8
5280     */
5281    /**
5282     * @syscap SystemCapability.Security.Huks.Core
5283     * @atomicservice
5284     * @since 12
5285     */
5286    HUKS_TAG_KEY = HuksTagType.HUKS_TAG_TYPE_BYTES | 10006,
5287    /**
5288     * @syscap SystemCapability.Security.Huks.Extension
5289     * @since 8
5290     * @deprecated since 9
5291     */
5292    HUKS_TAG_KEY_VERSION = HuksTagType.HUKS_TAG_TYPE_UINT | 10007,
5293    /**
5294     * @syscap SystemCapability.Security.Huks.Extension
5295     * @since 8
5296     * @deprecated since 9
5297     */
5298    HUKS_TAG_PAYLOAD_LEN = HuksTagType.HUKS_TAG_TYPE_UINT | 10008,
5299
5300    /**
5301     * @syscap SystemCapability.Security.Huks.Core
5302     * @since 8
5303     */
5304    /**
5305     * @syscap SystemCapability.Security.Huks.Core
5306     * @atomicservice
5307     * @since 11
5308     */
5309    HUKS_TAG_AE_TAG = HuksTagType.HUKS_TAG_TYPE_BYTES | 10009,
5310
5311    /**
5312     * @syscap SystemCapability.Security.Huks.Core
5313     * @since 8
5314     * @deprecated since 9
5315     */
5316    HUKS_TAG_IS_KEY_HANDLE = HuksTagType.HUKS_TAG_TYPE_ULONG | 10010,
5317
5318    /**
5319     * Os version related TAG.
5320     *
5321     * @syscap SystemCapability.Security.Huks.Core
5322     * @since 8
5323     * @deprecated since 9
5324     */
5325    HUKS_TAG_OS_VERSION = HuksTagType.HUKS_TAG_TYPE_UINT | 10101,
5326    /**
5327     * @syscap SystemCapability.Security.Huks.Core
5328     * @since 8
5329     * @deprecated since 9
5330     */
5331    HUKS_TAG_OS_PATCHLEVEL = HuksTagType.HUKS_TAG_TYPE_UINT | 10102,
5332
5333    /*
5334     * Reserved TAGs: 11000 - 12000
5335     *
5336     * Other TAGs: 20001 - N
5337     * TAGs used for paramSetOut
5338     */
5339
5340    /**
5341     * @syscap SystemCapability.Security.Huks.Core
5342     * @since 8
5343     */
5344    /**
5345     * @syscap SystemCapability.Security.Huks.Core
5346     * @atomicservice
5347     * @since 12
5348     */
5349    HUKS_TAG_SYMMETRIC_KEY_DATA = HuksTagType.HUKS_TAG_TYPE_BYTES | 20001,
5350    /**
5351     * @syscap SystemCapability.Security.Huks.Extension
5352     * @since 8
5353     */
5354    /**
5355     * @syscap SystemCapability.Security.Huks.Core
5356     * @atomicservice
5357     * @since 12
5358     */
5359    HUKS_TAG_ASYMMETRIC_PUBLIC_KEY_DATA = HuksTagType.HUKS_TAG_TYPE_BYTES | 20002,
5360    /**
5361     * @syscap SystemCapability.Security.Huks.Extension
5362     * @since 8
5363     */
5364    /**
5365     * @syscap SystemCapability.Security.Huks.Core
5366     * @atomicservice
5367     * @since 12
5368     */
5369    HUKS_TAG_ASYMMETRIC_PRIVATE_KEY_DATA = HuksTagType.HUKS_TAG_TYPE_BYTES | 20003
5370  }
5371}
5372
5373export default huks;
5374