• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 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 AssetStoreKit
19 */
20
21/**
22 * This module provides the capabilities for life cycle management of sensitive user data (Asset) such as passwords
23 * and tokens, including adding, removing, updating, and querying.
24 *
25 * @namespace asset
26 * @syscap SystemCapability.Security.Asset
27 * @since 11
28 */
29/**
30 * This module provides the capabilities for life cycle management of sensitive user data (Asset) such as passwords
31 * and tokens, including adding, removing, updating, and querying.
32 *
33 * @namespace asset
34 * @syscap SystemCapability.Security.Asset
35 * @atomicservice
36 * @since 14
37 */
38declare namespace asset {
39  /**
40   * Add an Asset.
41   * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently
42   *     by setting {@link Tag.IS_PERSISTENT} tag.
43   *
44   * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added.
45   * @returns { Promise<void> } the promise object returned by the function.
46   * @throws { BusinessError } 201 - The caller doesn't have the permission.
47   * @throws { BusinessError } 401 - Parameter error. Possible causes:
48   *     1. Mandatory parameters are left unspecified.
49   *     2. Incorrect parameter types.
50   *     3. Parameter verification failed.
51   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
52   * @throws { BusinessError } 24000003 - The asset already exists.
53   * @throws { BusinessError } 24000005 - The screen lock status does not match.
54   * @throws { BusinessError } 24000006 - Insufficient memory.
55   * @throws { BusinessError } 24000007 - The asset is corrupted.
56   * @throws { BusinessError } 24000008 - The database operation failed.
57   * @throws { BusinessError } 24000009 - The cryptography operation failed.
58   * @throws { BusinessError } 24000010 - IPC failed.
59   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
60   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
61   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
62   * @throws { BusinessError } 24000014 - The file operation failed.
63   * @throws { BusinessError } 24000015 - Getting the system time failed.
64   * @syscap SystemCapability.Security.Asset
65   * @since 11
66   */
67  /**
68   * Add an Asset.
69   * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently
70   *     by setting {@link Tag.IS_PERSISTENT} tag.
71   *
72   * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added.
73   * @returns { Promise<void> } the promise object returned by the function.
74   * @throws { BusinessError } 201 - The caller doesn't have the permission.
75   * @throws { BusinessError } 401 - Parameter error. Possible causes:
76   *     1. Mandatory parameters are left unspecified.
77   *     2. Incorrect parameter types.
78   *     3. Parameter verification failed.
79   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
80   * @throws { BusinessError } 24000003 - The asset already exists.
81   * @throws { BusinessError } 24000005 - The screen lock status does not match.
82   * @throws { BusinessError } 24000006 - Insufficient memory.
83   * @throws { BusinessError } 24000007 - The asset is corrupted.
84   * @throws { BusinessError } 24000008 - The database operation failed.
85   * @throws { BusinessError } 24000009 - The cryptography operation failed.
86   * @throws { BusinessError } 24000010 - IPC failed.
87   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
88   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
89   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
90   * @throws { BusinessError } 24000014 - The file operation failed.
91   * @throws { BusinessError } 24000015 - Getting the system time failed.
92   * @syscap SystemCapability.Security.Asset
93   * @atomicservice
94   * @since 14
95   */
96  function add(attributes: AssetMap): Promise<void>;
97
98  /**
99   * Add an Asset to a specific user space.
100   * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently
101   *     by setting {@link Tag.IS_PERSISTENT} tag.
102   *
103   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
104   * @param { number } userId - the user identifier to add an Asset. The user identifier cannot be lower than 100.
105   * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added.
106   * @returns { Promise<void> } the promise object returned by the function.
107   * @throws { BusinessError } 201 - The caller doesn't have the permission.
108   * @throws { BusinessError } 202 - Non-system applications use system APIs.
109   * @throws { BusinessError } 401 - Parameter error. Possible causes:
110   *     1. Mandatory parameters are left unspecified.
111   *     2. Incorrect parameter types.
112   *     3. Parameter verification failed.
113   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
114   * @throws { BusinessError } 24000003 - The asset already exists.
115   * @throws { BusinessError } 24000005 - The screen lock status does not match.
116   * @throws { BusinessError } 24000006 - Insufficient memory.
117   * @throws { BusinessError } 24000007 - The asset is corrupted.
118   * @throws { BusinessError } 24000008 - The database operation failed.
119   * @throws { BusinessError } 24000009 - The cryptography operation failed.
120   * @throws { BusinessError } 24000010 - IPC failed.
121   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
122   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
123   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
124   * @throws { BusinessError } 24000014 - The file operation failed.
125   * @throws { BusinessError } 24000015 - Getting the system time failed.
126   * @syscap SystemCapability.Security.Asset
127   * @systemapi
128   * @since 12
129   */
130  function addAsUser(userId: number, attributes: AssetMap): Promise<void>;
131
132  /**
133   * Add an Asset.
134   * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently
135   *     by setting {@link Tag.IS_PERSISTENT} tag.
136   *
137   * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added.
138   * @throws { BusinessError } 201 - The caller doesn't have the permission.
139   * @throws { BusinessError } 401 - Parameter error. Possible causes:
140   *     1. Mandatory parameters are left unspecified.
141   *     2. Incorrect parameter types.
142   *     3. Parameter verification failed.
143   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
144   * @throws { BusinessError } 24000003 - The asset already exists.
145   * @throws { BusinessError } 24000005 - The screen lock status does not match.
146   * @throws { BusinessError } 24000006 - Insufficient memory.
147   * @throws { BusinessError } 24000007 - The asset is corrupted.
148   * @throws { BusinessError } 24000008 - The database operation failed.
149   * @throws { BusinessError } 24000009 - The cryptography operation failed.
150   * @throws { BusinessError } 24000010 - IPC failed.
151   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
152   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
153   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
154   * @throws { BusinessError } 24000014 - The file operation failed.
155   * @throws { BusinessError } 24000015 - Getting the system time failed.
156   * @syscap SystemCapability.Security.Asset
157   * @since 12
158   */
159  /**
160   * Add an Asset.
161   * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently
162   *     by setting {@link Tag.IS_PERSISTENT} tag.
163   *
164   * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added.
165   * @throws { BusinessError } 201 - The caller doesn't have the permission.
166   * @throws { BusinessError } 401 - Parameter error. Possible causes:
167   *     1. Mandatory parameters are left unspecified.
168   *     2. Incorrect parameter types.
169   *     3. Parameter verification failed.
170   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
171   * @throws { BusinessError } 24000003 - The asset already exists.
172   * @throws { BusinessError } 24000005 - The screen lock status does not match.
173   * @throws { BusinessError } 24000006 - Insufficient memory.
174   * @throws { BusinessError } 24000007 - The asset is corrupted.
175   * @throws { BusinessError } 24000008 - The database operation failed.
176   * @throws { BusinessError } 24000009 - The cryptography operation failed.
177   * @throws { BusinessError } 24000010 - IPC failed.
178   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
179   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
180   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
181   * @throws { BusinessError } 24000014 - The file operation failed.
182   * @throws { BusinessError } 24000015 - Getting the system time failed.
183   * @syscap SystemCapability.Security.Asset
184   * @atomicservice
185   * @since 14
186   */
187  function addSync(attributes: AssetMap): void;
188
189  /**
190   * Remove one or more Assets that match a search query.
191   *
192   * @param { AssetMap } query - a map object containing attributes of the Asset to be removed.
193   * @returns { Promise<void> } the promise object returned by the function.
194   * @throws { BusinessError } 401 - Parameter error. Possible causes:
195   *     1. Incorrect parameter types.
196   *     2. Parameter verification failed.
197   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
198   * @throws { BusinessError } 24000002 - The asset is not found.
199   * @throws { BusinessError } 24000006 - Insufficient memory.
200   * @throws { BusinessError } 24000007 - The asset is corrupted.
201   * @throws { BusinessError } 24000008 - The database operation failed.
202   * @throws { BusinessError } 24000010 - IPC failed.
203   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
204   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
205   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
206   * @throws { BusinessError } 24000015 - Getting the system time failed.
207   * @syscap SystemCapability.Security.Asset
208   * @since 11
209   */
210  /**
211   * Remove one or more Assets that match a search query.
212   *
213   * @param { AssetMap } query - a map object containing attributes of the Asset to be removed.
214   * @returns { Promise<void> } the promise object returned by the function.
215   * @throws { BusinessError } 401 - Parameter error. Possible causes:
216   *     1. Incorrect parameter types.
217   *     2. Parameter verification failed.
218   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
219   * @throws { BusinessError } 24000002 - The asset is not found.
220   * @throws { BusinessError } 24000006 - Insufficient memory.
221   * @throws { BusinessError } 24000007 - The asset is corrupted.
222   * @throws { BusinessError } 24000008 - The database operation failed.
223   * @throws { BusinessError } 24000010 - IPC failed.
224   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
225   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
226   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
227   * @throws { BusinessError } 24000015 - Getting the system time failed.
228   * @syscap SystemCapability.Security.Asset
229   * @atomicservice
230   * @since 14
231   */
232  function remove(query: AssetMap): Promise<void>;
233
234  /**
235   * Remove one or more Assets that match a search query from a specific user space.
236   *
237   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
238   * @param { number } userId - the user identifier to remove one or more Assets. The user identifier cannot be lower
239   *     than 100.
240   * @param { AssetMap } query - a map object containing attributes of the Asset to be removed.
241   * @returns { Promise<void> } the promise object returned by the function.
242   * @throws { BusinessError } 201 - The caller doesn't have the permission.
243   * @throws { BusinessError } 202 - Non-system applications use system APIs.
244   * @throws { BusinessError } 401 - Parameter error. Possible causes:
245   *     1. Incorrect parameter types.
246   *     2. Parameter verification failed.
247   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
248   * @throws { BusinessError } 24000002 - The asset is not found.
249   * @throws { BusinessError } 24000006 - Insufficient memory.
250   * @throws { BusinessError } 24000007 - The asset is corrupted.
251   * @throws { BusinessError } 24000008 - The database operation failed.
252   * @throws { BusinessError } 24000010 - IPC failed.
253   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
254   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
255   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
256   * @throws { BusinessError } 24000015 - Getting the system time failed.
257   * @syscap SystemCapability.Security.Asset
258   * @systemapi
259   * @since 12
260   */
261  function removeAsUser(userId: number, query: AssetMap): Promise<void>;
262
263  /**
264   * Remove one or more Assets that match a search query.
265   *
266   * @param { AssetMap } query - a map object containing attributes of the Asset to be removed.
267   * @throws { BusinessError } 401 - Parameter error. Possible causes:
268   *     1. Incorrect parameter types.
269   *     2. Parameter verification failed.
270   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
271   * @throws { BusinessError } 24000002 - The asset is not found.
272   * @throws { BusinessError } 24000006 - Insufficient memory.
273   * @throws { BusinessError } 24000007 - The asset is corrupted.
274   * @throws { BusinessError } 24000008 - The database operation failed.
275   * @throws { BusinessError } 24000010 - IPC failed.
276   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
277   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
278   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
279   * @throws { BusinessError } 24000015 - Getting the system time failed.
280   * @syscap SystemCapability.Security.Asset
281   * @since 12
282   */
283  /**
284   * Remove one or more Assets that match a search query.
285   *
286   * @param { AssetMap } query - a map object containing attributes of the Asset to be removed.
287   * @throws { BusinessError } 401 - Parameter error. Possible causes:
288   *     1. Incorrect parameter types.
289   *     2. Parameter verification failed.
290   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
291   * @throws { BusinessError } 24000002 - The asset is not found.
292   * @throws { BusinessError } 24000006 - Insufficient memory.
293   * @throws { BusinessError } 24000007 - The asset is corrupted.
294   * @throws { BusinessError } 24000008 - The database operation failed.
295   * @throws { BusinessError } 24000010 - IPC failed.
296   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
297   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
298   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
299   * @throws { BusinessError } 24000015 - Getting the system time failed.
300   * @syscap SystemCapability.Security.Asset
301   * @atomicservice
302   * @since 14
303   */
304  function removeSync(query: AssetMap): void;
305
306  /**
307   * Update an Asset that matches a search query.
308   *
309   * @param { AssetMap } query - a map object containing attributes of the Asset to be updated.
310   * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values.
311   * @returns { Promise<void> } the promise object returned by the function.
312   * @throws { BusinessError } 401 - Parameter error. Possible causes:
313   *     1. Mandatory parameters are left unspecified.
314   *     2. Incorrect parameter types.
315   *     3. Parameter verification failed.
316   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
317   * @throws { BusinessError } 24000002 - The asset is not found.
318   * @throws { BusinessError } 24000005 - The screen lock status does not match.
319   * @throws { BusinessError } 24000006 - Insufficient memory.
320   * @throws { BusinessError } 24000007 - The asset is corrupted.
321   * @throws { BusinessError } 24000008 - The database operation failed.
322   * @throws { BusinessError } 24000009 - The cryptography operation failed.
323   * @throws { BusinessError } 24000010 - IPC failed.
324   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
325   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
326   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
327   * @throws { BusinessError } 24000015 - Getting the system time failed.
328   * @syscap SystemCapability.Security.Asset
329   * @since 11
330   */
331  /**
332   * Update an Asset that matches a search query.
333   *
334   * @param { AssetMap } query - a map object containing attributes of the Asset to be updated.
335   * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values.
336   * @returns { Promise<void> } the promise object returned by the function.
337   * @throws { BusinessError } 401 - Parameter error. Possible causes:
338   *     1. Mandatory parameters are left unspecified.
339   *     2. Incorrect parameter types.
340   *     3. Parameter verification failed.
341   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
342   * @throws { BusinessError } 24000002 - The asset is not found.
343   * @throws { BusinessError } 24000005 - The screen lock status does not match.
344   * @throws { BusinessError } 24000006 - Insufficient memory.
345   * @throws { BusinessError } 24000007 - The asset is corrupted.
346   * @throws { BusinessError } 24000008 - The database operation failed.
347   * @throws { BusinessError } 24000009 - The cryptography operation failed.
348   * @throws { BusinessError } 24000010 - IPC failed.
349   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
350   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
351   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
352   * @throws { BusinessError } 24000015 - Getting the system time failed.
353   * @syscap SystemCapability.Security.Asset
354   * @atomicservice
355   * @since 14
356   */
357  function update(query: AssetMap, attributesToUpdate: AssetMap): Promise<void>;
358
359  /**
360   * Update an Asset that matches a search query in a specific user space.
361   *
362   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
363   * @param { number } userId - the user identifier to update an Asset. The user identifier cannot be lower than 100.
364   * @param { AssetMap } query - a map object containing attributes of the Asset to be updated.
365   * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values.
366   * @returns { Promise<void> } the promise object returned by the function.
367   * @throws { BusinessError } 201 - The caller doesn't have the permission.
368   * @throws { BusinessError } 202 - Non-system applications use system APIs.
369   * @throws { BusinessError } 401 - Parameter error. Possible causes:
370   *     1. Mandatory parameters are left unspecified.
371   *     2. Incorrect parameter types.
372   *     3. Parameter verification failed.
373   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
374   * @throws { BusinessError } 24000002 - The asset is not found.
375   * @throws { BusinessError } 24000005 - The screen lock status does not match.
376   * @throws { BusinessError } 24000006 - Insufficient memory.
377   * @throws { BusinessError } 24000007 - The asset is corrupted.
378   * @throws { BusinessError } 24000008 - The database operation failed.
379   * @throws { BusinessError } 24000009 - The cryptography operation failed.
380   * @throws { BusinessError } 24000010 - IPC failed.
381   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
382   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
383   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
384   * @throws { BusinessError } 24000015 - Getting the system time failed.
385   * @syscap SystemCapability.Security.Asset
386   * @systemapi
387   * @since 12
388   */
389  function updateAsUser(userId: number, query: AssetMap, attributesToUpdate: AssetMap): Promise<void>;
390
391  /**
392   * Update an Asset that matches a search query.
393   *
394   * @param { AssetMap } query - a map object containing attributes of the Asset to be updated.
395   * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values.
396   * @throws { BusinessError } 401 - Parameter error. Possible causes:
397   *     1. Mandatory parameters are left unspecified.
398   *     2. Incorrect parameter types.
399   *     3. Parameter verification failed.
400   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
401   * @throws { BusinessError } 24000002 - The asset is not found.
402   * @throws { BusinessError } 24000005 - The screen lock status does not match.
403   * @throws { BusinessError } 24000006 - Insufficient memory.
404   * @throws { BusinessError } 24000007 - The asset is corrupted.
405   * @throws { BusinessError } 24000008 - The database operation failed.
406   * @throws { BusinessError } 24000009 - The cryptography operation failed.
407   * @throws { BusinessError } 24000010 - IPC failed.
408   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
409   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
410   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
411   * @throws { BusinessError } 24000015 - Getting the system time failed.
412   * @syscap SystemCapability.Security.Asset
413   * @since 12
414   */
415  /**
416   * Update an Asset that matches a search query.
417   *
418   * @param { AssetMap } query - a map object containing attributes of the Asset to be updated.
419   * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values.
420   * @throws { BusinessError } 401 - Parameter error. Possible causes:
421   *     1. Mandatory parameters are left unspecified.
422   *     2. Incorrect parameter types.
423   *     3. Parameter verification failed.
424   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
425   * @throws { BusinessError } 24000002 - The asset is not found.
426   * @throws { BusinessError } 24000005 - The screen lock status does not match.
427   * @throws { BusinessError } 24000006 - Insufficient memory.
428   * @throws { BusinessError } 24000007 - The asset is corrupted.
429   * @throws { BusinessError } 24000008 - The database operation failed.
430   * @throws { BusinessError } 24000009 - The cryptography operation failed.
431   * @throws { BusinessError } 24000010 - IPC failed.
432   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
433   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
434   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
435   * @throws { BusinessError } 24000015 - Getting the system time failed.
436   * @syscap SystemCapability.Security.Asset
437   * @atomicservice
438   * @since 14
439   */
440  function updateSync(query: AssetMap, attributesToUpdate: AssetMap): void;
441
442  /**
443   * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication.
444   *
445   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
446   * @returns { Promise<Uint8Array> } the promise object returned by the function.
447   * @throws { BusinessError } 401 - Parameter error. Possible causes:
448   *     1. Incorrect parameter types.
449   *     2. Parameter verification failed.
450   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
451   * @throws { BusinessError } 24000002 - The asset is not found.
452   * @throws { BusinessError } 24000005 - The screen lock status does not match.
453   * @throws { BusinessError } 24000006 - Insufficient memory.
454   * @throws { BusinessError } 24000007 - The asset is corrupted.
455   * @throws { BusinessError } 24000008 - The database operation failed.
456   * @throws { BusinessError } 24000009 - The cryptography operation failed.
457   * @throws { BusinessError } 24000010 - IPC failed.
458   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
459   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
460   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
461   * @throws { BusinessError } 24000016 - The cache exceeds the limit.
462   * @throws { BusinessError } 24000017 - The capability is not supported.
463   * @syscap SystemCapability.Security.Asset
464   * @since 11
465   */
466  /**
467   * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication.
468   *
469   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
470   * @returns { Promise<Uint8Array> } the promise object returned by the function.
471   * @throws { BusinessError } 401 - Parameter error. Possible causes:
472   *     1. Incorrect parameter types.
473   *     2. Parameter verification failed.
474   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
475   * @throws { BusinessError } 24000002 - The asset is not found.
476   * @throws { BusinessError } 24000005 - The screen lock status does not match.
477   * @throws { BusinessError } 24000006 - Insufficient memory.
478   * @throws { BusinessError } 24000007 - The asset is corrupted.
479   * @throws { BusinessError } 24000008 - The database operation failed.
480   * @throws { BusinessError } 24000009 - The cryptography operation failed.
481   * @throws { BusinessError } 24000010 - IPC failed.
482   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
483   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
484   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
485   * @throws { BusinessError } 24000016 - The cache exceeds the limit.
486   * @throws { BusinessError } 24000017 - The capability is not supported.
487   * @syscap SystemCapability.Security.Asset
488   * @atomicservice
489   * @since 14
490   */
491  function preQuery(query: AssetMap): Promise<Uint8Array>;
492
493  /**
494   * Preprocessing (e.g. get challenge) for querying one or more Assets
495   * that require user authentication in a specific user space.
496   *
497   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
498   * @param { number } userId - the user identifier to pre-query one or more Assets. The user identifier cannot be
499   *     lower than 100.
500   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
501   * @returns { Promise<Uint8Array> } the promise object returned by the function.
502   * @throws { BusinessError } 201 - The caller doesn't have the permission.
503   * @throws { BusinessError } 202 - Non-system applications use system APIs.
504   * @throws { BusinessError } 401 - Parameter error. Possible causes:
505   *     1. Incorrect parameter types.
506   *     2. Parameter verification failed.
507   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
508   * @throws { BusinessError } 24000002 - The asset is not found.
509   * @throws { BusinessError } 24000005 - The screen lock status does not match.
510   * @throws { BusinessError } 24000006 - Insufficient memory.
511   * @throws { BusinessError } 24000007 - The asset is corrupted.
512   * @throws { BusinessError } 24000008 - The database operation failed.
513   * @throws { BusinessError } 24000009 - The cryptography operation failed.
514   * @throws { BusinessError } 24000010 - IPC failed.
515   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
516   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
517   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
518   * @throws { BusinessError } 24000016 - The cache exceeds the limit.
519   * @throws { BusinessError } 24000017 - The capability is not supported.
520   * @syscap SystemCapability.Security.Asset
521   * @systemapi
522   * @since 12
523   */
524  function preQueryAsUser(userId: number, query: AssetMap): Promise<Uint8Array>;
525
526  /**
527   * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication.
528   *
529   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
530   * @returns { Uint8Array } the challenge value to be used when {@link querySync} is called.
531   * @throws { BusinessError } 401 - Parameter error. Possible causes:
532   *     1. Incorrect parameter types.
533   *     2. Parameter verification failed.
534   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
535   * @throws { BusinessError } 24000002 - The asset is not found.
536   * @throws { BusinessError } 24000005 - The screen lock status does not match.
537   * @throws { BusinessError } 24000006 - Insufficient memory.
538   * @throws { BusinessError } 24000007 - The asset is corrupted.
539   * @throws { BusinessError } 24000008 - The database operation failed.
540   * @throws { BusinessError } 24000009 - The cryptography operation failed.
541   * @throws { BusinessError } 24000010 - IPC failed.
542   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
543   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
544   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
545   * @throws { BusinessError } 24000016 - The cache exceeds the limit.
546   * @throws { BusinessError } 24000017 - The capability is not supported.
547   * @syscap SystemCapability.Security.Asset
548   * @since 12
549   */
550  /**
551   * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication.
552   *
553   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
554   * @returns { Uint8Array } the challenge value to be used when {@link querySync} is called.
555   * @throws { BusinessError } 401 - Parameter error. Possible causes:
556   *     1. Incorrect parameter types.
557   *     2. Parameter verification failed.
558   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
559   * @throws { BusinessError } 24000002 - The asset is not found.
560   * @throws { BusinessError } 24000005 - The screen lock status does not match.
561   * @throws { BusinessError } 24000006 - Insufficient memory.
562   * @throws { BusinessError } 24000007 - The asset is corrupted.
563   * @throws { BusinessError } 24000008 - The database operation failed.
564   * @throws { BusinessError } 24000009 - The cryptography operation failed.
565   * @throws { BusinessError } 24000010 - IPC failed.
566   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
567   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
568   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
569   * @throws { BusinessError } 24000016 - The cache exceeds the limit.
570   * @throws { BusinessError } 24000017 - The capability is not supported.
571   * @syscap SystemCapability.Security.Asset
572   * @atomicservice
573   * @since 14
574   */
575  function preQuerySync(query: AssetMap): Uint8Array;
576
577  /**
578   * Query one or more Assets that match a search query.
579   *
580   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
581   * @returns { Promise<Array<AssetMap>> } the promise object returned by the function.
582   * @throws { BusinessError } 401 - Parameter error. Possible causes:
583   *     1. Incorrect parameter types.
584   *     2. Parameter verification failed.
585   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
586   * @throws { BusinessError } 24000002 - The asset is not found.
587   * @throws { BusinessError } 24000004 - Access denied.
588   * @throws { BusinessError } 24000005 - The screen lock status does not match.
589   * @throws { BusinessError } 24000006 - Insufficient memory.
590   * @throws { BusinessError } 24000007 - The asset is corrupted.
591   * @throws { BusinessError } 24000008 - The database operation failed.
592   * @throws { BusinessError } 24000009 - The cryptography operation failed.
593   * @throws { BusinessError } 24000010 - IPC failed.
594   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
595   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
596   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
597   * @throws { BusinessError } 24000017 - The capability is not supported.
598   * @syscap SystemCapability.Security.Asset
599   * @since 11
600   */
601  /**
602   * Query one or more Assets that match a search query.
603   *
604   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
605   * @returns { Promise<Array<AssetMap>> } the promise object returned by the function.
606   * @throws { BusinessError } 401 - Parameter error. Possible causes:
607   *     1. Incorrect parameter types.
608   *     2. Parameter verification failed.
609   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
610   * @throws { BusinessError } 24000002 - The asset is not found.
611   * @throws { BusinessError } 24000004 - Access denied.
612   * @throws { BusinessError } 24000005 - The screen lock status does not match.
613   * @throws { BusinessError } 24000006 - Insufficient memory.
614   * @throws { BusinessError } 24000007 - The asset is corrupted.
615   * @throws { BusinessError } 24000008 - The database operation failed.
616   * @throws { BusinessError } 24000009 - The cryptography operation failed.
617   * @throws { BusinessError } 24000010 - IPC failed.
618   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
619   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
620   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
621   * @throws { BusinessError } 24000017 - The capability is not supported.
622   * @syscap SystemCapability.Security.Asset
623   * @atomicservice
624   * @since 14
625   */
626  function query(query: AssetMap): Promise<Array<AssetMap>>;
627
628  /**
629   * Query one or more Assets that match a search query in a specific user space.
630   *
631   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
632   * @param { number } userId - the user identifier to query one or more Assets. The user identifier cannot be lower
633   *     than 100.
634   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
635   * @returns { Promise<Array<AssetMap>> } the promise object returned by the function.
636   * @throws { BusinessError } 201 - The caller doesn't have the permission.
637   * @throws { BusinessError } 202 - Non-system applications use system APIs.
638   * @throws { BusinessError } 401 - Parameter error. Possible causes:
639   *     1. Incorrect parameter types.
640   *     2. Parameter verification failed.
641   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
642   * @throws { BusinessError } 24000002 - The asset is not found.
643   * @throws { BusinessError } 24000004 - Access denied.
644   * @throws { BusinessError } 24000005 - The screen lock status does not match.
645   * @throws { BusinessError } 24000006 - Insufficient memory.
646   * @throws { BusinessError } 24000007 - The asset is corrupted.
647   * @throws { BusinessError } 24000008 - The database operation failed.
648   * @throws { BusinessError } 24000009 - The cryptography operation failed.
649   * @throws { BusinessError } 24000010 - IPC failed.
650   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
651   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
652   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
653   * @throws { BusinessError } 24000017 - The capability is not supported.
654   * @syscap SystemCapability.Security.Asset
655   * @systemapi
656   * @since 12
657   */
658  function queryAsUser(userId: number, query: AssetMap): Promise<Array<AssetMap>>;
659
660  /**
661   * Query one or more Assets that match a search query.
662   *
663   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
664   * @returns { Array<AssetMap> } the query result.
665   * @throws { BusinessError } 401 - Parameter error. Possible causes:
666   *     1. Incorrect parameter types.
667   *     2. Parameter verification failed.
668   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
669   * @throws { BusinessError } 24000002 - The asset is not found.
670   * @throws { BusinessError } 24000004 - Access denied.
671   * @throws { BusinessError } 24000005 - The screen lock status does not match.
672   * @throws { BusinessError } 24000006 - Insufficient memory.
673   * @throws { BusinessError } 24000007 - The asset is corrupted.
674   * @throws { BusinessError } 24000008 - The database operation failed.
675   * @throws { BusinessError } 24000009 - The cryptography operation failed.
676   * @throws { BusinessError } 24000010 - IPC failed.
677   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
678   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
679   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
680   * @throws { BusinessError } 24000017 - The capability is not supported.
681   * @syscap SystemCapability.Security.Asset
682   * @since 12
683   */
684  /**
685   * Query one or more Assets that match a search query.
686   *
687   * @param { AssetMap } query - a map object containing attributes of the Asset to be queried.
688   * @returns { Array<AssetMap> } the query result.
689   * @throws { BusinessError } 401 - Parameter error. Possible causes:
690   *     1. Incorrect parameter types.
691   *     2. Parameter verification failed.
692   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
693   * @throws { BusinessError } 24000002 - The asset is not found.
694   * @throws { BusinessError } 24000004 - Access denied.
695   * @throws { BusinessError } 24000005 - The screen lock status does not match.
696   * @throws { BusinessError } 24000006 - Insufficient memory.
697   * @throws { BusinessError } 24000007 - The asset is corrupted.
698   * @throws { BusinessError } 24000008 - The database operation failed.
699   * @throws { BusinessError } 24000009 - The cryptography operation failed.
700   * @throws { BusinessError } 24000010 - IPC failed.
701   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
702   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
703   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
704   * @throws { BusinessError } 24000017 - The capability is not supported.
705   * @syscap SystemCapability.Security.Asset
706   * @atomicservice
707   * @since 14
708   */
709  function querySync(query: AssetMap): Array<AssetMap>;
710
711  /**
712   * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication.
713   *
714   * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuery}.
715   * @returns { Promise<void> } the promise object returned by the function.
716   * @throws { BusinessError } 401 - Parameter error. Possible causes:
717   *     1. Mandatory parameters are left unspecified.
718   *     2. Incorrect parameter types.
719   *     3. Parameter verification failed.
720   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
721   * @throws { BusinessError } 24000006 - Insufficient memory.
722   * @throws { BusinessError } 24000010 - IPC failed.
723   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
724   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
725   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
726   * @syscap SystemCapability.Security.Asset
727   * @since 11
728   */
729  /**
730   * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication.
731   *
732   * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuery}.
733   * @returns { Promise<void> } the promise object returned by the function.
734   * @throws { BusinessError } 401 - Parameter error. Possible causes:
735   *     1. Mandatory parameters are left unspecified.
736   *     2. Incorrect parameter types.
737   *     3. Parameter verification failed.
738   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
739   * @throws { BusinessError } 24000006 - Insufficient memory.
740   * @throws { BusinessError } 24000010 - IPC failed.
741   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
742   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
743   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
744   * @syscap SystemCapability.Security.Asset
745   * @atomicservice
746   * @since 14
747   */
748  function postQuery(handle: AssetMap): Promise<void>;
749
750  /**
751   * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication in a
752   * specific user space.
753   *
754   * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
755   * @param { number } userId - the user identifier to post-query one or more Assets. The user identifier cannot be
756   *     lower than 100.
757   * @param { AssetMap } handle - a map object containing the handle returned by {@link preQueryAsUser}.
758   * @returns { Promise<void> } the promise object returned by the function.
759   * @throws { BusinessError } 201 - The caller doesn't have the permission.
760   * @throws { BusinessError } 202 - Non-system applications use system APIs.
761   * @throws { BusinessError } 401 - Parameter error. Possible causes:
762   *     1. Mandatory parameters are left unspecified.
763   *     2. Incorrect parameter types.
764   *     3. Parameter verification failed.
765   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
766   * @throws { BusinessError } 24000006 - Insufficient memory.
767   * @throws { BusinessError } 24000010 - IPC failed.
768   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
769   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
770   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
771   * @syscap SystemCapability.Security.Asset
772   * @systemapi
773   * @since 12
774   */
775  function postQueryAsUser(userId:number, handle: AssetMap): Promise<void>;
776
777  /**
778   * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication.
779   *
780   * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuerySync}.
781   * @throws { BusinessError } 401 - Parameter error. Possible causes:
782   *     1. Mandatory parameters are left unspecified.
783   *     2. Incorrect parameter types.
784   *     3. Parameter verification failed.
785   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
786   * @throws { BusinessError } 24000006 - Insufficient memory.
787   * @throws { BusinessError } 24000010 - IPC failed.
788   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
789   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
790   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
791   * @syscap SystemCapability.Security.Asset
792   * @since 12
793   */
794  /**
795   * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication.
796   *
797   * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuerySync}.
798   * @throws { BusinessError } 401 - Parameter error. Possible causes:
799   *     1. Mandatory parameters are left unspecified.
800   *     2. Incorrect parameter types.
801   *     3. Parameter verification failed.
802   * @throws { BusinessError } 24000001 - The ASSET service is unavailable.
803   * @throws { BusinessError } 24000006 - Insufficient memory.
804   * @throws { BusinessError } 24000010 - IPC failed.
805   * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed.
806   * @throws { BusinessError } 24000012 - Calling the OS Account service failed.
807   * @throws { BusinessError } 24000013 - Calling the Access Token service failed.
808   * @syscap SystemCapability.Security.Asset
809   * @atomicservice
810   * @since 14
811   */
812  function postQuerySync(handle: AssetMap): void;
813
814  /**
815   * A Map type containing tag-value pairs that describe the attributes of an Asset.
816   *
817   * @typedef { Map<Tag, Value> }
818   * @syscap SystemCapability.Security.Asset
819   * @since 11
820   */
821  /**
822   * A Map type containing tag-value pairs that describe the attributes of an Asset.
823   *
824   * @typedef { Map<Tag, Value> }
825   * @syscap SystemCapability.Security.Asset
826   * @atomicservice
827   * @since 14
828   */
829  type AssetMap = Map<Tag, Value>;
830
831  /**
832   * A type that indicates the secret or attribute value of an Asset tag.
833   *
834   * @typedef { boolean | number | Uint8Array }
835   * @syscap SystemCapability.Security.Asset
836   * @since 11
837   */
838  /**
839   * A type that indicates the secret or attribute value of an Asset tag.
840   *
841   * @typedef { boolean | number | Uint8Array }
842   * @syscap SystemCapability.Security.Asset
843   * @atomicservice
844   * @since 14
845   */
846  type Value = boolean | number | Uint8Array;
847
848  /**
849   * An enum type indicates when the Asset is accessible.
850   *
851   * @enum { number }
852   * @syscap SystemCapability.Security.Asset
853   * @since 11
854   */
855  /**
856   * An enum type indicates when the Asset is accessible.
857   *
858   * @enum { number }
859   * @syscap SystemCapability.Security.Asset
860   * @atomicservice
861   * @since 14
862   */
863  enum Accessibility {
864    /**
865     * The secret value in the Asset can only be accessed after the device is powered on.
866     *
867     * @syscap SystemCapability.Security.Asset
868     * @since 11
869     */
870    /**
871     * The secret value in the Asset can only be accessed after the device is powered on.
872     *
873     * @syscap SystemCapability.Security.Asset
874     * @atomicservice
875     * @since 14
876     */
877    DEVICE_POWERED_ON = 0,
878    /**
879     * The secret value in the Asset can only be accessed after the device is first unlocked.
880     *
881     * @syscap SystemCapability.Security.Asset
882     * @since 11
883     */
884    /**
885     * The secret value in the Asset can only be accessed after the device is first unlocked.
886     *
887     * @syscap SystemCapability.Security.Asset
888     * @atomicservice
889     * @since 14
890     */
891    DEVICE_FIRST_UNLOCKED = 1,
892    /**
893     * The secret value in the Asset can only be accessed while the device is unlocked.
894     *
895     * @syscap SystemCapability.Security.Asset
896     * @since 11
897     */
898    /**
899     * The secret value in the Asset can only be accessed while the device is unlocked.
900     *
901     * @syscap SystemCapability.Security.Asset
902     * @atomicservice
903     * @since 14
904     */
905    DEVICE_UNLOCKED = 2,
906  }
907
908  /**
909   * An enum type indicates the user authentication type for Asset access control.
910   *
911   * @enum { number }
912   * @syscap SystemCapability.Security.Asset
913   * @since 11
914   */
915  /**
916   * An enum type indicates the user authentication type for Asset access control.
917   *
918   * @enum { number }
919   * @syscap SystemCapability.Security.Asset
920   * @atomicservice
921   * @since 14
922   */
923  enum AuthType {
924    /**
925     * The access to an Asset doesn't require user authentication.
926     *
927     * @syscap SystemCapability.Security.Asset
928     * @since 11
929     */
930    /**
931     * The access to an Asset doesn't require user authentication.
932     *
933     * @syscap SystemCapability.Security.Asset
934     * @atomicservice
935     * @since 14
936     */
937    NONE = 0x00,
938    /**
939     * The access to an Asset requires user authentication using either PIN/pattern/password or biometric traits.
940     *
941     * @syscap SystemCapability.Security.Asset
942     * @since 11
943     */
944    /**
945     * The access to an Asset requires user authentication using either PIN/pattern/password or biometric traits.
946     *
947     * @syscap SystemCapability.Security.Asset
948     * @atomicservice
949     * @since 14
950     */
951    ANY = 0xFF,
952  }
953
954  /**
955   * An enum type indicates the type of Asset synchronization.
956   *
957   * @enum { number }
958   * @syscap SystemCapability.Security.Asset
959   * @since 11
960   */
961  /**
962   * An enum type indicates the type of Asset synchronization.
963   *
964   * @enum { number }
965   * @syscap SystemCapability.Security.Asset
966   * @atomicservice
967   * @since 14
968   */
969  enum SyncType {
970    /**
971     * An Asset with this attribute value is never allowed to be transferred out.
972     *
973     * @syscap SystemCapability.Security.Asset
974     * @since 11
975     */
976    /**
977     * An Asset with this attribute value is never allowed to be transferred out.
978     *
979     * @syscap SystemCapability.Security.Asset
980     * @atomicservice
981     * @since 14
982     */
983    NEVER = 0,
984    /**
985     * An Asset with this attribute value can only be restored to the device from which it was transferred out.
986     *
987     * @syscap SystemCapability.Security.Asset
988     * @since 11
989     */
990    /**
991     * An Asset with this attribute value can only be restored to the device from which it was transferred out.
992     *
993     * @syscap SystemCapability.Security.Asset
994     * @atomicservice
995     * @since 14
996     */
997    THIS_DEVICE = 1 << 0,
998    /**
999     * An Asset with this attribute value can only be transferred out to a trusted device (user authorized).
1000     *
1001     * @syscap SystemCapability.Security.Asset
1002     * @since 11
1003     */
1004    /**
1005     * An Asset with this attribute value can only be transferred out to a trusted device (user authorized).
1006     *
1007     * @syscap SystemCapability.Security.Asset
1008     * @atomicservice
1009     * @since 14
1010     */
1011    TRUSTED_DEVICE = 1 << 1,
1012    /**
1013     * An Asset with this attribute value can only be transferred out to devices logged in with trusted accounts.
1014     *
1015     * @syscap SystemCapability.Security.Asset
1016     * @since 12
1017     */
1018    /**
1019     * An Asset with this attribute value can only be transferred out to devices logged in with trusted accounts.
1020     *
1021     * @syscap SystemCapability.Security.Asset
1022     * @atomicservice
1023     * @since 14
1024     */
1025    TRUSTED_ACCOUNT = 1 << 2,
1026  }
1027
1028  /**
1029   * An enum type indicates the type of Asset encapsulation.
1030   *
1031   * @enum { number }
1032   * @syscap SystemCapability.Security.Asset
1033   * @since 18
1034   */
1035  enum WrapType {
1036    /**
1037     * An Asset with this attribute value is never allowed to be wrapped up.
1038     *
1039     * @syscap SystemCapability.Security.Asset
1040     * @since 18
1041     */
1042    NEVER = 0,
1043    /**
1044     * An Asset with this attribute value can only be wrapped or unwrapped on devices logged in with trusted accounts.
1045     *
1046     * @syscap SystemCapability.Security.Asset
1047     * @since 18
1048     */
1049    TRUSTED_ACCOUNT = 1,
1050  }
1051
1052  /**
1053   * An enum type indicates the strategy for conflict resolution when handling duplicated Asset alias.
1054   *
1055   * @enum { number }
1056   * @syscap SystemCapability.Security.Asset
1057   * @since 11
1058   */
1059  /**
1060   * An enum type indicates the strategy for conflict resolution when handling duplicated Asset alias.
1061   *
1062   * @enum { number }
1063   * @syscap SystemCapability.Security.Asset
1064   * @atomicservice
1065   * @since 14
1066   */
1067  enum ConflictResolution {
1068    /**
1069     * Directly overwrite an Asset with duplicated alias when a conflict is detected.
1070     *
1071     * @syscap SystemCapability.Security.Asset
1072     * @since 11
1073     */
1074    /**
1075     * Directly overwrite an Asset with duplicated alias when a conflict is detected.
1076     *
1077     * @syscap SystemCapability.Security.Asset
1078     * @atomicservice
1079     * @since 14
1080     */
1081    OVERWRITE = 0,
1082    /**
1083     * Throw an error so that the caller can take measures when a conflict is detected.
1084     *
1085     * @syscap SystemCapability.Security.Asset
1086     * @since 11
1087     */
1088    /**
1089     * Throw an error so that the caller can take measures when a conflict is detected.
1090     *
1091     * @syscap SystemCapability.Security.Asset
1092     * @atomicservice
1093     * @since 14
1094     */
1095    THROW_ERROR = 1,
1096  }
1097
1098  /**
1099   * An enum type indicates the return type of the queried Asset.
1100   *
1101   * @enum { number }
1102   * @syscap SystemCapability.Security.Asset
1103   * @since 11
1104   */
1105  /**
1106   * An enum type indicates the return type of the queried Asset.
1107   *
1108   * @enum { number }
1109   * @syscap SystemCapability.Security.Asset
1110   * @atomicservice
1111   * @since 14
1112   */
1113  enum ReturnType {
1114    /**
1115     * Specify that the return data should contain both secret value and attributes.
1116     *
1117     * @syscap SystemCapability.Security.Asset
1118     * @since 11
1119     */
1120    /**
1121     * Specify that the return data should contain both secret value and attributes.
1122     *
1123     * @syscap SystemCapability.Security.Asset
1124     * @atomicservice
1125     * @since 14
1126     */
1127    ALL = 0,
1128    /**
1129     * Specify that the return data contains only attributes.
1130     *
1131     * @syscap SystemCapability.Security.Asset
1132     * @since 11
1133     */
1134    /**
1135     * Specify that the return data contains only attributes.
1136     *
1137     * @syscap SystemCapability.Security.Asset
1138     * @atomicservice
1139     * @since 14
1140     */
1141    ATTRIBUTES = 1,
1142  }
1143
1144  /**
1145   * An enum type indicates the additional action to be performed during operation.
1146   *
1147   * @enum { number }
1148   * @syscap SystemCapability.Security.Asset
1149   * @since 12
1150   */
1151  enum OperationType {
1152    /**
1153     * Synchronization is required during operation.
1154     *
1155     * @syscap SystemCapability.Security.Asset
1156     * @since 12
1157     */
1158    NEED_SYNC = 0,
1159    /**
1160     * Logout is required during operation.
1161     *
1162     * @syscap SystemCapability.Security.Asset
1163     * @since 12
1164     */
1165    NEED_LOGOUT = 1,
1166  }
1167
1168  /**
1169   * An enum type containing the data type definitions for Asset attribute value.
1170   *
1171   * @enum { number }
1172   * @syscap SystemCapability.Security.Asset
1173   * @since 11
1174   */
1175  /**
1176   * An enum type containing the data type definitions for Asset attribute value.
1177   *
1178   * @enum { number }
1179   * @syscap SystemCapability.Security.Asset
1180   * @atomicservice
1181   * @since 14
1182   */
1183  enum TagType {
1184    /**
1185     * The data type of Asset attribute value is bool.
1186     *
1187     * @syscap SystemCapability.Security.Asset
1188     * @since 11
1189     */
1190    /**
1191     * The data type of Asset attribute value is bool.
1192     *
1193     * @syscap SystemCapability.Security.Asset
1194     * @atomicservice
1195     * @since 14
1196     */
1197    BOOL = 0x01 << 28,
1198    /**
1199     * The data type of Asset attribute value is uint32.
1200     *
1201     * @syscap SystemCapability.Security.Asset
1202     * @since 11
1203     */
1204    /**
1205     * The data type of Asset attribute value is uint32.
1206     *
1207     * @syscap SystemCapability.Security.Asset
1208     * @atomicservice
1209     * @since 14
1210     */
1211    NUMBER = 0x02 << 28,
1212    /**
1213     * The data type of Asset attribute value is byte array.
1214     *
1215     * @syscap SystemCapability.Security.Asset
1216     * @since 11
1217     */
1218    /**
1219     * The data type of Asset attribute value is byte array.
1220     *
1221     * @syscap SystemCapability.Security.Asset
1222     * @atomicservice
1223     * @since 14
1224     */
1225    BYTES = 0x03 << 28,
1226  }
1227
1228  /**
1229   * An enum type containing the Asset attribute tags.
1230   *
1231   * @enum { number }
1232   * @syscap SystemCapability.Security.Asset
1233   * @since 11
1234   */
1235  /**
1236   * An enum type containing the Asset attribute tags.
1237   *
1238   * @enum { number }
1239   * @syscap SystemCapability.Security.Asset
1240   * @atomicservice
1241   * @since 14
1242   */
1243  enum Tag {
1244    /**
1245     * A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens.
1246     *
1247     * @syscap SystemCapability.Security.Asset
1248     * @since 11
1249     */
1250    /**
1251     * A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens.
1252     *
1253     * @syscap SystemCapability.Security.Asset
1254     * @atomicservice
1255     * @since 14
1256     */
1257    SECRET = TagType.BYTES | 0x01,
1258    /**
1259     * A tag whose value is a byte array identifying an Asset.
1260     *
1261     * @syscap SystemCapability.Security.Asset
1262     * @since 11
1263     */
1264    /**
1265     * A tag whose value is a byte array identifying an Asset.
1266     *
1267     * @syscap SystemCapability.Security.Asset
1268     * @atomicservice
1269     * @since 14
1270     */
1271    ALIAS = TagType.BYTES | 0x02,
1272    /**
1273     * A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed.
1274     *
1275     * @syscap SystemCapability.Security.Asset
1276     * @since 11
1277     */
1278    /**
1279     * A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed.
1280     *
1281     * @syscap SystemCapability.Security.Asset
1282     * @atomicservice
1283     * @since 14
1284     */
1285    ACCESSIBILITY = TagType.NUMBER | 0x03,
1286    /**
1287     * A tag whose value is a bool indicating whether a screen lock password is required for the device.
1288     *
1289     * @syscap SystemCapability.Security.Asset
1290     * @since 11
1291     */
1292    /**
1293     * A tag whose value is a bool indicating whether a screen lock password is required for the device.
1294     *
1295     * @syscap SystemCapability.Security.Asset
1296     * @atomicservice
1297     * @since 14
1298     */
1299    REQUIRE_PASSWORD_SET = TagType.BOOL | 0x04,
1300    /**
1301     * A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control.
1302     *
1303     * @syscap SystemCapability.Security.Asset
1304     * @since 11
1305     */
1306    /**
1307     * A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control.
1308     *
1309     * @syscap SystemCapability.Security.Asset
1310     * @atomicservice
1311     * @since 14
1312     */
1313    AUTH_TYPE = TagType.NUMBER | 0x05,
1314    /**
1315     * A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication.
1316     *
1317     * @syscap SystemCapability.Security.Asset
1318     * @since 11
1319     */
1320    /**
1321     * A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication.
1322     *
1323     * @syscap SystemCapability.Security.Asset
1324     * @atomicservice
1325     * @since 14
1326     */
1327    AUTH_VALIDITY_PERIOD = TagType.NUMBER | 0x06,
1328    /**
1329     * A tag whose value is a byte array indicating the authentication challenge for anti-replay protection.
1330     *
1331     * @syscap SystemCapability.Security.Asset
1332     * @since 11
1333     */
1334    /**
1335     * A tag whose value is a byte array indicating the authentication challenge for anti-replay protection.
1336     *
1337     * @syscap SystemCapability.Security.Asset
1338     * @atomicservice
1339     * @since 14
1340     */
1341    AUTH_CHALLENGE = TagType.BYTES | 0x07,
1342    /**
1343     * A tag whose value is a byte array indicating the authentication token after a user is verified.
1344     *
1345     * @syscap SystemCapability.Security.Asset
1346     * @since 11
1347     */
1348    /**
1349     * A tag whose value is a byte array indicating the authentication token after a user is verified.
1350     *
1351     * @syscap SystemCapability.Security.Asset
1352     * @atomicservice
1353     * @since 14
1354     */
1355    AUTH_TOKEN = TagType.BYTES | 0x08,
1356    /**
1357     * A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization.
1358     *
1359     * @syscap SystemCapability.Security.Asset
1360     * @since 11
1361     */
1362    /**
1363     * A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization.
1364     *
1365     * @syscap SystemCapability.Security.Asset
1366     * @atomicservice
1367     * @since 14
1368     */
1369    SYNC_TYPE = TagType.NUMBER | 0x10,
1370    /**
1371     * A tag whose value is a bool indicating whether Asset is stored persistently.
1372     *
1373     * @syscap SystemCapability.Security.Asset
1374     * @since 11
1375     */
1376    IS_PERSISTENT = TagType.BOOL | 0x11,
1377    /**
1378     * A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update).
1379     *
1380     * @syscap SystemCapability.Security.Asset
1381     * @since 11
1382     */
1383    /**
1384     * A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update).
1385     *
1386     * @syscap SystemCapability.Security.Asset
1387     * @atomicservice
1388     * @since 14
1389     */
1390    DATA_LABEL_CRITICAL_1 = TagType.BYTES | 0x20,
1391    /**
1392     * A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update).
1393     *
1394     * @syscap SystemCapability.Security.Asset
1395     * @since 11
1396     */
1397    /**
1398     * A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update).
1399     *
1400     * @syscap SystemCapability.Security.Asset
1401     * @atomicservice
1402     * @since 14
1403     */
1404    DATA_LABEL_CRITICAL_2 = TagType.BYTES | 0x21,
1405    /**
1406     * A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update).
1407     *
1408     * @syscap SystemCapability.Security.Asset
1409     * @since 11
1410     */
1411    /**
1412     * A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update).
1413     *
1414     * @syscap SystemCapability.Security.Asset
1415     * @atomicservice
1416     * @since 14
1417     */
1418    DATA_LABEL_CRITICAL_3 = TagType.BYTES | 0x22,
1419    /**
1420     * A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update).
1421     *
1422     * @syscap SystemCapability.Security.Asset
1423     * @since 11
1424     */
1425    /**
1426     * A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update).
1427     *
1428     * @syscap SystemCapability.Security.Asset
1429     * @atomicservice
1430     * @since 14
1431     */
1432    DATA_LABEL_CRITICAL_4 = TagType.BYTES | 0x23,
1433    /**
1434     * A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update).
1435     *
1436     * @syscap SystemCapability.Security.Asset
1437     * @since 11
1438     */
1439    /**
1440     * A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update).
1441     *
1442     * @syscap SystemCapability.Security.Asset
1443     * @atomicservice
1444     * @since 14
1445     */
1446    DATA_LABEL_NORMAL_1 = TagType.BYTES | 0x30,
1447    /**
1448     * A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update).
1449     *
1450     * @syscap SystemCapability.Security.Asset
1451     * @since 11
1452     */
1453    /**
1454     * A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update).
1455     *
1456     * @syscap SystemCapability.Security.Asset
1457     * @atomicservice
1458     * @since 14
1459     */
1460    DATA_LABEL_NORMAL_2 = TagType.BYTES | 0x31,
1461    /**
1462     * A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update).
1463     *
1464     * @syscap SystemCapability.Security.Asset
1465     * @since 11
1466     */
1467    /**
1468     * A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update).
1469     *
1470     * @syscap SystemCapability.Security.Asset
1471     * @atomicservice
1472     * @since 14
1473     */
1474    DATA_LABEL_NORMAL_3 = TagType.BYTES | 0x32,
1475    /**
1476     * A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update).
1477     *
1478     * @syscap SystemCapability.Security.Asset
1479     * @since 11
1480     */
1481    /**
1482     * A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update).
1483     *
1484     * @syscap SystemCapability.Security.Asset
1485     * @atomicservice
1486     * @since 14
1487     */
1488    DATA_LABEL_NORMAL_4 = TagType.BYTES | 0x33,
1489    /**
1490     * A local tag whose value is a byte array indicating the first user-defined Asset data label (allow to update).
1491     * The information of a local tag will not be synchronized.
1492     *
1493     * @syscap SystemCapability.Security.Asset
1494     * @since 12
1495     */
1496    /**
1497     * A local tag whose value is a byte array indicating the first user-defined Asset data label (allow to update).
1498     * The information of a local tag will not be synchronized.
1499     *
1500     * @syscap SystemCapability.Security.Asset
1501     * @atomicservice
1502     * @since 14
1503     */
1504    DATA_LABEL_NORMAL_LOCAL_1 = TagType.BYTES | 0x34,
1505    /**
1506     * A local tag whose value is a byte array indicating the second user-defined Asset data label (allow to update).
1507     * The information of a local tag will not be synchronized.
1508     *
1509     * @syscap SystemCapability.Security.Asset
1510     * @since 12
1511     */
1512    /**
1513     * A local tag whose value is a byte array indicating the second user-defined Asset data label (allow to update).
1514     * The information of a local tag will not be synchronized.
1515     *
1516     * @syscap SystemCapability.Security.Asset
1517     * @atomicservice
1518     * @since 14
1519     */
1520    DATA_LABEL_NORMAL_LOCAL_2 = TagType.BYTES | 0x35,
1521    /**
1522     * A local tag whose value is a byte array indicating the third user-defined Asset data label (allow to update).
1523     * The information of a local tag will not be synchronized.
1524     *
1525     * @syscap SystemCapability.Security.Asset
1526     * @since 12
1527     */
1528    /**
1529     * A local tag whose value is a byte array indicating the third user-defined Asset data label (allow to update).
1530     * The information of a local tag will not be synchronized.
1531     *
1532     * @syscap SystemCapability.Security.Asset
1533     * @atomicservice
1534     * @since 14
1535     */
1536    DATA_LABEL_NORMAL_LOCAL_3 = TagType.BYTES | 0x36,
1537    /**
1538     * A local tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update).
1539     * The information of a local tag will not be synchronized.
1540     *
1541     * @syscap SystemCapability.Security.Asset
1542     * @since 12
1543     */
1544    /**
1545     * A local tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update).
1546     * The information of a local tag will not be synchronized.
1547     *
1548     * @syscap SystemCapability.Security.Asset
1549     * @atomicservice
1550     * @since 14
1551     */
1552    DATA_LABEL_NORMAL_LOCAL_4 = TagType.BYTES | 0x37,
1553    /**
1554     * A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset.
1555     *
1556     * @syscap SystemCapability.Security.Asset
1557     * @since 11
1558     */
1559    /**
1560     * A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset.
1561     *
1562     * @syscap SystemCapability.Security.Asset
1563     * @atomicservice
1564     * @since 14
1565     */
1566    RETURN_TYPE = TagType.NUMBER | 0x40,
1567    /**
1568     * A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query.
1569     *
1570     * @syscap SystemCapability.Security.Asset
1571     * @since 11
1572     */
1573    /**
1574     * A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query.
1575     *
1576     * @syscap SystemCapability.Security.Asset
1577     * @atomicservice
1578     * @since 14
1579     */
1580    RETURN_LIMIT = TagType.NUMBER | 0x41,
1581    /**
1582     * A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query.
1583     *
1584     * @syscap SystemCapability.Security.Asset
1585     * @since 11
1586     */
1587    /**
1588     * A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query.
1589     *
1590     * @syscap SystemCapability.Security.Asset
1591     * @atomicservice
1592     * @since 14
1593     */
1594    RETURN_OFFSET = TagType.NUMBER | 0x42,
1595    /**
1596     * A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted.
1597     *
1598     * @syscap SystemCapability.Security.Asset
1599     * @since 11
1600     */
1601    /**
1602     * A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted.
1603     *
1604     * @syscap SystemCapability.Security.Asset
1605     * @atomicservice
1606     * @since 14
1607     */
1608    RETURN_ORDERED_BY = TagType.NUMBER | 0x43,
1609    /**
1610     * A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts.
1611     *
1612     * @syscap SystemCapability.Security.Asset
1613     * @since 11
1614     */
1615    /**
1616     * A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts.
1617     *
1618     * @syscap SystemCapability.Security.Asset
1619     * @atomicservice
1620     * @since 14
1621     */
1622    CONFLICT_RESOLUTION = TagType.NUMBER | 0x44,
1623    /**
1624     * A tag whose value is a byte array indicating the update time of an Asset.
1625     *
1626     * @syscap SystemCapability.Security.Asset
1627     * @since 12
1628     */
1629    /**
1630     * A tag whose value is a byte array indicating the update time of an Asset.
1631     *
1632     * @syscap SystemCapability.Security.Asset
1633     * @atomicservice
1634     * @since 14
1635     */
1636    UPDATE_TIME = TagType.BYTES | 0x45,
1637    /**
1638     * A tag whose value is a 32-bit unsigned integer indicating the additional action to be performed during operation.
1639     *
1640     * @syscap SystemCapability.Security.Asset
1641     * @since 12
1642     */
1643    OPERATION_TYPE = TagType.NUMBER | 0x46,
1644    /**
1645     * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted.
1646     *
1647     * @syscap SystemCapability.Security.Asset
1648     * @atomicservice
1649     * @since 14
1650     */
1651    REQUIRE_ATTR_ENCRYPTED = TagType.BOOL | 0x47,
1652    /**
1653     * A tag whose value is a byte array indicating the group id an asset belongs to.
1654     *
1655     * @syscap SystemCapability.Security.Asset
1656     * @since 18
1657     */
1658    GROUP_ID = TagType.BYTES | 0x48,
1659    /**
1660     * A tag whose value is a 32-bit unsigned integer indicating the type of Asset encapsulation.
1661     *
1662     * @syscap SystemCapability.Security.Asset
1663     * @since 18
1664     */
1665    WRAP_TYPE = TagType.NUMBER | 0x49,
1666  }
1667
1668  /**
1669   * An enum type containing the Asset error codes.
1670   *
1671   * @enum { number }
1672   * @syscap SystemCapability.Security.Asset
1673   * @since 11
1674   */
1675  /**
1676   * An enum type containing the Asset error codes.
1677   *
1678   * @enum { number }
1679   * @syscap SystemCapability.Security.Asset
1680   * @atomicservice
1681   * @since 14
1682   */
1683  enum ErrorCode {
1684    /**
1685     * The error code indicates that the caller doesn't have the permission.
1686     *
1687     * @syscap SystemCapability.Security.Asset
1688     * @since 11
1689     */
1690    PERMISSION_DENIED = 201,
1691    /**
1692     * The error code indicates that the caller is not a system application.
1693     *
1694     * @syscap SystemCapability.Security.Asset
1695     * @since 12
1696     */
1697    NOT_SYSTEM_APPLICATION = 202,
1698    /**
1699     * The error code indicates that the argument is invalid.
1700     *
1701     * @syscap SystemCapability.Security.Asset
1702     * @since 11
1703     */
1704    /**
1705     * The error code indicates that the argument is invalid.
1706     *
1707     * @syscap SystemCapability.Security.Asset
1708     * @atomicservice
1709     * @since 14
1710     */
1711    INVALID_ARGUMENT = 401,
1712    /**
1713     * The error code indicates that the ASSET service is unavailable.
1714     *
1715     * @syscap SystemCapability.Security.Asset
1716     * @since 11
1717     */
1718    /**
1719     * The error code indicates that the ASSET service is unavailable.
1720     *
1721     * @syscap SystemCapability.Security.Asset
1722     * @atomicservice
1723     * @since 14
1724     */
1725    SERVICE_UNAVAILABLE = 24000001,
1726    /**
1727     * The error code indicates that the asset is not found.
1728     *
1729     * @syscap SystemCapability.Security.Asset
1730     * @since 11
1731     */
1732    /**
1733     * The error code indicates that the asset is not found.
1734     *
1735     * @syscap SystemCapability.Security.Asset
1736     * @atomicservice
1737     * @since 14
1738     */
1739    NOT_FOUND = 24000002,
1740    /**
1741     * The error code indicates that the asset already exists.
1742     *
1743     * @syscap SystemCapability.Security.Asset
1744     * @since 11
1745     */
1746    /**
1747     * The error code indicates that the asset already exists.
1748     *
1749     * @syscap SystemCapability.Security.Asset
1750     * @atomicservice
1751     * @since 14
1752     */
1753    DUPLICATED = 24000003,
1754    /**
1755     * The error code indicates that access to the asset is denied.
1756     *
1757     * @syscap SystemCapability.Security.Asset
1758     * @since 11
1759     */
1760    /**
1761     * The error code indicates that access to the asset is denied.
1762     *
1763     * @syscap SystemCapability.Security.Asset
1764     * @atomicservice
1765     * @since 14
1766     */
1767    ACCESS_DENIED = 24000004,
1768    /**
1769     * The error code indicates that the screen lock status does not match.
1770     *
1771     * @syscap SystemCapability.Security.Asset
1772     * @since 11
1773     */
1774    /**
1775     * The error code indicates that the screen lock status does not match.
1776     *
1777     * @syscap SystemCapability.Security.Asset
1778     * @atomicservice
1779     * @since 14
1780     */
1781    STATUS_MISMATCH = 24000005,
1782    /**
1783     * The error code indicates insufficient memory.
1784     *
1785     * @syscap SystemCapability.Security.Asset
1786     * @since 11
1787     */
1788    /**
1789     * The error code indicates insufficient memory.
1790     *
1791     * @syscap SystemCapability.Security.Asset
1792     * @atomicservice
1793     * @since 14
1794     */
1795    OUT_OF_MEMORY = 24000006,
1796    /**
1797     * The error code indicates that the asset is corrupted.
1798     *
1799     * @syscap SystemCapability.Security.Asset
1800     * @since 11
1801     */
1802    /**
1803     * The error code indicates that the asset is corrupted.
1804     *
1805     * @syscap SystemCapability.Security.Asset
1806     * @atomicservice
1807     * @since 14
1808     */
1809    DATA_CORRUPTED = 24000007,
1810    /**
1811     * The error code indicates that the database operation failed.
1812     *
1813     * @syscap SystemCapability.Security.Asset
1814     * @since 11
1815     */
1816    /**
1817     * The error code indicates that the database operation failed.
1818     *
1819     * @syscap SystemCapability.Security.Asset
1820     * @atomicservice
1821     * @since 14
1822     */
1823    DATABASE_ERROR = 24000008,
1824    /**
1825     * The error code indicates that the cryptography operation failed.
1826     *
1827     * @syscap SystemCapability.Security.Asset
1828     * @since 11
1829     */
1830    /**
1831     * The error code indicates that the cryptography operation failed.
1832     *
1833     * @syscap SystemCapability.Security.Asset
1834     * @atomicservice
1835     * @since 14
1836     */
1837    CRYPTO_ERROR = 24000009,
1838    /**
1839     * The error code indicates that the ipc failed.
1840     *
1841     * @syscap SystemCapability.Security.Asset
1842     * @since 11
1843     */
1844    /**
1845     * The error code indicates that the ipc failed.
1846     *
1847     * @syscap SystemCapability.Security.Asset
1848     * @atomicservice
1849     * @since 14
1850     */
1851    IPC_ERROR = 24000010,
1852    /**
1853     * The error code indicates that calling the Bundle Manager service failed.
1854     *
1855     * @syscap SystemCapability.Security.Asset
1856     * @since 11
1857     */
1858    /**
1859     * The error code indicates that calling the Bundle Manager service failed.
1860     *
1861     * @syscap SystemCapability.Security.Asset
1862     * @atomicservice
1863     * @since 14
1864     */
1865    BMS_ERROR = 24000011,
1866    /**
1867     * The error code indicates that calling the OS Account service failed.
1868     *
1869     * @syscap SystemCapability.Security.Asset
1870     * @since 11
1871     */
1872    /**
1873     * The error code indicates that calling the OS Account service failed.
1874     *
1875     * @syscap SystemCapability.Security.Asset
1876     * @atomicservice
1877     * @since 14
1878     */
1879    ACCOUNT_ERROR = 24000012,
1880    /**
1881     * The error code indicates that calling the Access Token service failed.
1882     *
1883     * @syscap SystemCapability.Security.Asset
1884     * @since 11
1885     */
1886    /**
1887     * The error code indicates that calling the Access Token service failed.
1888     *
1889     * @syscap SystemCapability.Security.Asset
1890     * @atomicservice
1891     * @since 14
1892     */
1893    ACCESS_TOKEN_ERROR = 24000013,
1894    /**
1895     * The error code indicates that the file operation failed.
1896     *
1897     * @syscap SystemCapability.Security.Asset
1898     * @since 11
1899     */
1900    /**
1901     * The error code indicates that the file operation failed.
1902     *
1903     * @syscap SystemCapability.Security.Asset
1904     * @atomicservice
1905     * @since 14
1906     */
1907    FILE_OPERATION_ERROR = 24000014,
1908    /**
1909     * The error code indicates that getting the system time failed.
1910     *
1911     * @syscap SystemCapability.Security.Asset
1912     * @since 11
1913     */
1914    /**
1915     * The error code indicates that getting the system time failed.
1916     *
1917     * @syscap SystemCapability.Security.Asset
1918     * @atomicservice
1919     * @since 14
1920     */
1921    GET_SYSTEM_TIME_ERROR = 24000015,
1922    /**
1923     * The error code indicates that the cache exceeds the limit.
1924     *
1925     * @syscap SystemCapability.Security.Asset
1926     * @since 11
1927     */
1928    /**
1929     * The error code indicates that the cache exceeds the limit.
1930     *
1931     * @syscap SystemCapability.Security.Asset
1932     * @atomicservice
1933     * @since 14
1934     */
1935    LIMIT_EXCEEDED = 24000016,
1936    /**
1937     * The error code indicates that the capability is not supported.
1938     *
1939     * @syscap SystemCapability.Security.Asset
1940     * @since 11
1941     */
1942    /**
1943     * The error code indicates that the capability is not supported.
1944     *
1945     * @syscap SystemCapability.Security.Asset
1946     * @atomicservice
1947     * @since 14
1948     */
1949    UNSUPPORTED = 24000017,
1950  }
1951}
1952
1953export default asset;
1954