161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit AssetStoreKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ci/** 2261847f8eSopenharmony_ci * This module provides the capabilities for life cycle management of sensitive user data (Asset) such as passwords 2361847f8eSopenharmony_ci * and tokens, including adding, removing, updating, and querying. 2461847f8eSopenharmony_ci * 2561847f8eSopenharmony_ci * @namespace asset 2661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 2761847f8eSopenharmony_ci * @since 11 2861847f8eSopenharmony_ci */ 2961847f8eSopenharmony_cideclare namespace asset { 3061847f8eSopenharmony_ci /** 3161847f8eSopenharmony_ci * Add an Asset. 3261847f8eSopenharmony_ci * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently 3361847f8eSopenharmony_ci * by setting {@link Tag.IS_PERSISTENT} tag. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added. 3661847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 3761847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 3861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 3961847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 4061847f8eSopenharmony_ci * 2. Incorrect parameter types. 4161847f8eSopenharmony_ci * 3. Parameter verification failed. 4261847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 4361847f8eSopenharmony_ci * @throws { BusinessError } 24000003 - The asset already exists. 4461847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 4561847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 4661847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 4761847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 4861847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 4961847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 5061847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 5161847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 5261847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 5361847f8eSopenharmony_ci * @throws { BusinessError } 24000014 - The file operation failed. 5461847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 5561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 5661847f8eSopenharmony_ci * @since 11 5761847f8eSopenharmony_ci */ 5861847f8eSopenharmony_ci function add(attributes: AssetMap): Promise<void>; 5961847f8eSopenharmony_ci 6061847f8eSopenharmony_ci /** 6161847f8eSopenharmony_ci * Add an Asset to a specific user space. 6261847f8eSopenharmony_ci * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently 6361847f8eSopenharmony_ci * by setting {@link Tag.IS_PERSISTENT} tag. 6461847f8eSopenharmony_ci * 6561847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 6661847f8eSopenharmony_ci * @param { number } userId - the user identifier to add an Asset. The user identifier cannot be lower than 100. 6761847f8eSopenharmony_ci * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added. 6861847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 6961847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 7061847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 7161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 7261847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 7361847f8eSopenharmony_ci * 2. Incorrect parameter types. 7461847f8eSopenharmony_ci * 3. Parameter verification failed. 7561847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 7661847f8eSopenharmony_ci * @throws { BusinessError } 24000003 - The asset already exists. 7761847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 7861847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 7961847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 8061847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 8161847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 8261847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 8361847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 8461847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 8561847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 8661847f8eSopenharmony_ci * @throws { BusinessError } 24000014 - The file operation failed. 8761847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 8861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 8961847f8eSopenharmony_ci * @systemapi 9061847f8eSopenharmony_ci * @since 12 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci function addAsUser(userId: number, attributes: AssetMap): Promise<void>; 9361847f8eSopenharmony_ci 9461847f8eSopenharmony_ci /** 9561847f8eSopenharmony_ci * Add an Asset. 9661847f8eSopenharmony_ci * Permission ohos.permission.STORE_PERSISTENT_DATA is required when the Asset needs to be stored persistently 9761847f8eSopenharmony_ci * by setting {@link Tag.IS_PERSISTENT} tag. 9861847f8eSopenharmony_ci * 9961847f8eSopenharmony_ci * @param { AssetMap } attributes - a map object containing attributes of the Asset to be added. 10061847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 10161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 10261847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 10361847f8eSopenharmony_ci * 2. Incorrect parameter types. 10461847f8eSopenharmony_ci * 3. Parameter verification failed. 10561847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 10661847f8eSopenharmony_ci * @throws { BusinessError } 24000003 - The asset already exists. 10761847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 10861847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 10961847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 11061847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 11161847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 11261847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 11361847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 11461847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 11561847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 11661847f8eSopenharmony_ci * @throws { BusinessError } 24000014 - The file operation failed. 11761847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 11861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 11961847f8eSopenharmony_ci * @since 12 12061847f8eSopenharmony_ci */ 12161847f8eSopenharmony_ci function addSync(attributes: AssetMap): void; 12261847f8eSopenharmony_ci 12361847f8eSopenharmony_ci /** 12461847f8eSopenharmony_ci * Remove one or more Assets that match a search query. 12561847f8eSopenharmony_ci * 12661847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be removed. 12761847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 12861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 12961847f8eSopenharmony_ci * 1. Incorrect parameter types. 13061847f8eSopenharmony_ci * 2. Parameter verification failed. 13161847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 13261847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 13361847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 13461847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 13561847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 13661847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 13761847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 13861847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 13961847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 14061847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 14161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 14261847f8eSopenharmony_ci * @since 11 14361847f8eSopenharmony_ci */ 14461847f8eSopenharmony_ci function remove(query: AssetMap): Promise<void>; 14561847f8eSopenharmony_ci 14661847f8eSopenharmony_ci /** 14761847f8eSopenharmony_ci * Remove one or more Assets that match a search query from a specific user space. 14861847f8eSopenharmony_ci * 14961847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 15061847f8eSopenharmony_ci * @param { number } userId - the user identifier to remove one or more Assets. The user identifier cannot be lower 15161847f8eSopenharmony_ci * than 100. 15261847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be removed. 15361847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 15461847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 15561847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 15661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 15761847f8eSopenharmony_ci * 1. Incorrect parameter types. 15861847f8eSopenharmony_ci * 2. Parameter verification failed. 15961847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 16061847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 16161847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 16261847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 16361847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 16461847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 16561847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 16661847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 16761847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 16861847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 16961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 17061847f8eSopenharmony_ci * @systemapi 17161847f8eSopenharmony_ci * @since 12 17261847f8eSopenharmony_ci */ 17361847f8eSopenharmony_ci function removeAsUser(userId: number, query: AssetMap): Promise<void>; 17461847f8eSopenharmony_ci 17561847f8eSopenharmony_ci /** 17661847f8eSopenharmony_ci * Remove one or more Assets that match a search query. 17761847f8eSopenharmony_ci * 17861847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be removed. 17961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 18061847f8eSopenharmony_ci * 1. Incorrect parameter types. 18161847f8eSopenharmony_ci * 2. Parameter verification failed. 18261847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 18361847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 18461847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 18561847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 18661847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 18761847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 18861847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 18961847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 19061847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 19161847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 19261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 19361847f8eSopenharmony_ci * @since 12 19461847f8eSopenharmony_ci */ 19561847f8eSopenharmony_ci function removeSync(query: AssetMap): void; 19661847f8eSopenharmony_ci 19761847f8eSopenharmony_ci /** 19861847f8eSopenharmony_ci * Update an Asset that matches a search query. 19961847f8eSopenharmony_ci * 20061847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be updated. 20161847f8eSopenharmony_ci * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values. 20261847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 20361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 20461847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 20561847f8eSopenharmony_ci * 2. Incorrect parameter types. 20661847f8eSopenharmony_ci * 3. Parameter verification failed. 20761847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 20861847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 20961847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 21061847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 21161847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 21261847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 21361847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 21461847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 21561847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 21661847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 21761847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 21861847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 21961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 22061847f8eSopenharmony_ci * @since 11 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci function update(query: AssetMap, attributesToUpdate: AssetMap): Promise<void>; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Update an Asset that matches a search query in a specific user space. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 22861847f8eSopenharmony_ci * @param { number } userId - the user identifier to update an Asset. The user identifier cannot be lower than 100. 22961847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be updated. 23061847f8eSopenharmony_ci * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values. 23161847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 23261847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 23361847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 23461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 23561847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 23661847f8eSopenharmony_ci * 2. Incorrect parameter types. 23761847f8eSopenharmony_ci * 3. Parameter verification failed. 23861847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 23961847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 24061847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 24161847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 24261847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 24361847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 24461847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 24561847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 24661847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 24761847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 24861847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 24961847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 25061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 25161847f8eSopenharmony_ci * @systemapi 25261847f8eSopenharmony_ci * @since 12 25361847f8eSopenharmony_ci */ 25461847f8eSopenharmony_ci function updateAsUser(userId: number, query: AssetMap, attributesToUpdate: AssetMap): Promise<void>; 25561847f8eSopenharmony_ci 25661847f8eSopenharmony_ci /** 25761847f8eSopenharmony_ci * Update an Asset that matches a search query. 25861847f8eSopenharmony_ci * 25961847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be updated. 26061847f8eSopenharmony_ci * @param { AssetMap } attributesToUpdate - a map object containing attributes with new values. 26161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 26261847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 26361847f8eSopenharmony_ci * 2. Incorrect parameter types. 26461847f8eSopenharmony_ci * 3. Parameter verification failed. 26561847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 26661847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 26761847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 26861847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 26961847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 27061847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 27161847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 27261847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 27361847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 27461847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 27561847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 27661847f8eSopenharmony_ci * @throws { BusinessError } 24000015 - Getting the system time failed. 27761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 27861847f8eSopenharmony_ci * @since 12 27961847f8eSopenharmony_ci */ 28061847f8eSopenharmony_ci function updateSync(query: AssetMap, attributesToUpdate: AssetMap): void; 28161847f8eSopenharmony_ci 28261847f8eSopenharmony_ci /** 28361847f8eSopenharmony_ci * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication. 28461847f8eSopenharmony_ci * 28561847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 28661847f8eSopenharmony_ci * @returns { Promise<Uint8Array> } the promise object returned by the function. 28761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 28861847f8eSopenharmony_ci * 1. Incorrect parameter types. 28961847f8eSopenharmony_ci * 2. Parameter verification failed. 29061847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 29161847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 29261847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 29361847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 29461847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 29561847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 29661847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 29761847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 29861847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 29961847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 30061847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 30161847f8eSopenharmony_ci * @throws { BusinessError } 24000016 - The cache exceeds the limit. 30261847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 30361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 30461847f8eSopenharmony_ci * @since 11 30561847f8eSopenharmony_ci */ 30661847f8eSopenharmony_ci function preQuery(query: AssetMap): Promise<Uint8Array>; 30761847f8eSopenharmony_ci 30861847f8eSopenharmony_ci /** 30961847f8eSopenharmony_ci * Preprocessing (e.g. get challenge) for querying one or more Assets 31061847f8eSopenharmony_ci * that require user authentication in a specific user space. 31161847f8eSopenharmony_ci * 31261847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 31361847f8eSopenharmony_ci * @param { number } userId - the user identifier to pre-query one or more Assets. The user identifier cannot be 31461847f8eSopenharmony_ci * lower than 100. 31561847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 31661847f8eSopenharmony_ci * @returns { Promise<Uint8Array> } the promise object returned by the function. 31761847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 31861847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 31961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 32061847f8eSopenharmony_ci * 1. Incorrect parameter types. 32161847f8eSopenharmony_ci * 2. Parameter verification failed. 32261847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 32361847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 32461847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 32561847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 32661847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 32761847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 32861847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 32961847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 33061847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 33161847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 33261847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 33361847f8eSopenharmony_ci * @throws { BusinessError } 24000016 - The cache exceeds the limit. 33461847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 33561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 33661847f8eSopenharmony_ci * @systemapi 33761847f8eSopenharmony_ci * @since 12 33861847f8eSopenharmony_ci */ 33961847f8eSopenharmony_ci function preQueryAsUser(userId: number, query: AssetMap): Promise<Uint8Array>; 34061847f8eSopenharmony_ci 34161847f8eSopenharmony_ci /** 34261847f8eSopenharmony_ci * Preprocessing (e.g. get challenge) for querying one or more Assets that require user authentication. 34361847f8eSopenharmony_ci * 34461847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 34561847f8eSopenharmony_ci * @returns { Uint8Array } the challenge value to be used when {@link querySync} is called. 34661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 34761847f8eSopenharmony_ci * 1. Incorrect parameter types. 34861847f8eSopenharmony_ci * 2. Parameter verification failed. 34961847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 35061847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 35161847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 35261847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 35361847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 35461847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 35561847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 35661847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 35761847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 35861847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 35961847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 36061847f8eSopenharmony_ci * @throws { BusinessError } 24000016 - The cache exceeds the limit. 36161847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 36261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 36361847f8eSopenharmony_ci * @since 12 36461847f8eSopenharmony_ci */ 36561847f8eSopenharmony_ci function preQuerySync(query: AssetMap): Uint8Array; 36661847f8eSopenharmony_ci 36761847f8eSopenharmony_ci /** 36861847f8eSopenharmony_ci * Query one or more Assets that match a search query. 36961847f8eSopenharmony_ci * 37061847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 37161847f8eSopenharmony_ci * @returns { Promise<Array<AssetMap>> } the promise object returned by the function. 37261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 37361847f8eSopenharmony_ci * 1. Incorrect parameter types. 37461847f8eSopenharmony_ci * 2. Parameter verification failed. 37561847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 37661847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 37761847f8eSopenharmony_ci * @throws { BusinessError } 24000004 - Access denied. 37861847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 37961847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 38061847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 38161847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 38261847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 38361847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 38461847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 38561847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 38661847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 38761847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 38861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 38961847f8eSopenharmony_ci * @since 11 39061847f8eSopenharmony_ci */ 39161847f8eSopenharmony_ci function query(query: AssetMap): Promise<Array<AssetMap>>; 39261847f8eSopenharmony_ci 39361847f8eSopenharmony_ci /** 39461847f8eSopenharmony_ci * Query one or more Assets that match a search query in a specific user space. 39561847f8eSopenharmony_ci * 39661847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 39761847f8eSopenharmony_ci * @param { number } userId - the user identifier to query one or more Assets. The user identifier cannot be lower 39861847f8eSopenharmony_ci * than 100. 39961847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 40061847f8eSopenharmony_ci * @returns { Promise<Array<AssetMap>> } the promise object returned by the function. 40161847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 40261847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 40361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 40461847f8eSopenharmony_ci * 1. Incorrect parameter types. 40561847f8eSopenharmony_ci * 2. Parameter verification failed. 40661847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 40761847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 40861847f8eSopenharmony_ci * @throws { BusinessError } 24000004 - Access denied. 40961847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 41061847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 41161847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 41261847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 41361847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 41461847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 41561847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 41661847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 41761847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 41861847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 41961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 42061847f8eSopenharmony_ci * @systemapi 42161847f8eSopenharmony_ci * @since 12 42261847f8eSopenharmony_ci */ 42361847f8eSopenharmony_ci function queryAsUser(userId: number, query: AssetMap): Promise<Array<AssetMap>>; 42461847f8eSopenharmony_ci 42561847f8eSopenharmony_ci /** 42661847f8eSopenharmony_ci * Query one or more Assets that match a search query. 42761847f8eSopenharmony_ci * 42861847f8eSopenharmony_ci * @param { AssetMap } query - a map object containing attributes of the Asset to be queried. 42961847f8eSopenharmony_ci * @returns { Array<AssetMap> } the query result. 43061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 43161847f8eSopenharmony_ci * 1. Incorrect parameter types. 43261847f8eSopenharmony_ci * 2. Parameter verification failed. 43361847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 43461847f8eSopenharmony_ci * @throws { BusinessError } 24000002 - The asset is not found. 43561847f8eSopenharmony_ci * @throws { BusinessError } 24000004 - Access denied. 43661847f8eSopenharmony_ci * @throws { BusinessError } 24000005 - The screen lock status does not match. 43761847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 43861847f8eSopenharmony_ci * @throws { BusinessError } 24000007 - The asset is corrupted. 43961847f8eSopenharmony_ci * @throws { BusinessError } 24000008 - The database operation failed. 44061847f8eSopenharmony_ci * @throws { BusinessError } 24000009 - The cryptography operation failed. 44161847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 44261847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 44361847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 44461847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 44561847f8eSopenharmony_ci * @throws { BusinessError } 24000017 - The capability is not supported. 44661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 44761847f8eSopenharmony_ci * @since 12 44861847f8eSopenharmony_ci */ 44961847f8eSopenharmony_ci function querySync(query: AssetMap): Array<AssetMap>; 45061847f8eSopenharmony_ci 45161847f8eSopenharmony_ci /** 45261847f8eSopenharmony_ci * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication. 45361847f8eSopenharmony_ci * 45461847f8eSopenharmony_ci * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuery}. 45561847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 45661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 45761847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 45861847f8eSopenharmony_ci * 2. Incorrect parameter types. 45961847f8eSopenharmony_ci * 3. Parameter verification failed. 46061847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 46161847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 46261847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 46361847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 46461847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 46561847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 46661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 46761847f8eSopenharmony_ci * @since 11 46861847f8eSopenharmony_ci */ 46961847f8eSopenharmony_ci function postQuery(handle: AssetMap): Promise<void>; 47061847f8eSopenharmony_ci 47161847f8eSopenharmony_ci /** 47261847f8eSopenharmony_ci * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication in a 47361847f8eSopenharmony_ci * specific user space. 47461847f8eSopenharmony_ci * 47561847f8eSopenharmony_ci * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS 47661847f8eSopenharmony_ci * @param { number } userId - the user identifier to post-query one or more Assets. The user identifier cannot be 47761847f8eSopenharmony_ci * lower than 100. 47861847f8eSopenharmony_ci * @param { AssetMap } handle - a map object containing the handle returned by {@link preQueryAsUser}. 47961847f8eSopenharmony_ci * @returns { Promise<void> } the promise object returned by the function. 48061847f8eSopenharmony_ci * @throws { BusinessError } 201 - The caller doesn't have the permission. 48161847f8eSopenharmony_ci * @throws { BusinessError } 202 - Non-system applications use system APIs. 48261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 48361847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 48461847f8eSopenharmony_ci * 2. Incorrect parameter types. 48561847f8eSopenharmony_ci * 3. Parameter verification failed. 48661847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 48761847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 48861847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 48961847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 49061847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 49161847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 49261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 49361847f8eSopenharmony_ci * @systemapi 49461847f8eSopenharmony_ci * @since 12 49561847f8eSopenharmony_ci */ 49661847f8eSopenharmony_ci function postQueryAsUser(userId:number, handle: AssetMap): Promise<void>; 49761847f8eSopenharmony_ci 49861847f8eSopenharmony_ci /** 49961847f8eSopenharmony_ci * Post-processing (e.g. release cached resource) for querying multiple Assets that require user authentication. 50061847f8eSopenharmony_ci * 50161847f8eSopenharmony_ci * @param { AssetMap } handle - a map object containing the handle returned by {@link preQuerySync}. 50261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 50361847f8eSopenharmony_ci * 1. Mandatory parameters are left unspecified. 50461847f8eSopenharmony_ci * 2. Incorrect parameter types. 50561847f8eSopenharmony_ci * 3. Parameter verification failed. 50661847f8eSopenharmony_ci * @throws { BusinessError } 24000001 - The ASSET service is unavailable. 50761847f8eSopenharmony_ci * @throws { BusinessError } 24000006 - Insufficient memory. 50861847f8eSopenharmony_ci * @throws { BusinessError } 24000010 - IPC failed. 50961847f8eSopenharmony_ci * @throws { BusinessError } 24000011 - Calling the Bundle Manager service failed. 51061847f8eSopenharmony_ci * @throws { BusinessError } 24000012 - Calling the OS Account service failed. 51161847f8eSopenharmony_ci * @throws { BusinessError } 24000013 - Calling the Access Token service failed. 51261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 51361847f8eSopenharmony_ci * @since 12 51461847f8eSopenharmony_ci */ 51561847f8eSopenharmony_ci function postQuerySync(handle: AssetMap): void; 51661847f8eSopenharmony_ci 51761847f8eSopenharmony_ci /** 51861847f8eSopenharmony_ci * A Map type containing tag-value pairs that describe the attributes of an Asset. 51961847f8eSopenharmony_ci * 52061847f8eSopenharmony_ci * @typedef { Map<Tag, Value> } 52161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 52261847f8eSopenharmony_ci * @since 11 52361847f8eSopenharmony_ci */ 52461847f8eSopenharmony_ci type AssetMap = Map<Tag, Value>; 52561847f8eSopenharmony_ci 52661847f8eSopenharmony_ci /** 52761847f8eSopenharmony_ci * A type that indicates the secret or attribute value of an Asset tag. 52861847f8eSopenharmony_ci * 52961847f8eSopenharmony_ci * @typedef { boolean | number | Uint8Array } 53061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 53161847f8eSopenharmony_ci * @since 11 53261847f8eSopenharmony_ci */ 53361847f8eSopenharmony_ci type Value = boolean | number | Uint8Array; 53461847f8eSopenharmony_ci 53561847f8eSopenharmony_ci /** 53661847f8eSopenharmony_ci * An enum type indicates when the Asset is accessible. 53761847f8eSopenharmony_ci * 53861847f8eSopenharmony_ci * @enum { number } 53961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 54061847f8eSopenharmony_ci * @since 11 54161847f8eSopenharmony_ci */ 54261847f8eSopenharmony_ci enum Accessibility { 54361847f8eSopenharmony_ci /** 54461847f8eSopenharmony_ci * The secret value in the Asset can only be accessed after the device is powered on. 54561847f8eSopenharmony_ci * 54661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 54761847f8eSopenharmony_ci * @since 11 54861847f8eSopenharmony_ci */ 54961847f8eSopenharmony_ci DEVICE_POWERED_ON = 0, 55061847f8eSopenharmony_ci /** 55161847f8eSopenharmony_ci * The secret value in the Asset can only be accessed after the device is first unlocked. 55261847f8eSopenharmony_ci * 55361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 55461847f8eSopenharmony_ci * @since 11 55561847f8eSopenharmony_ci */ 55661847f8eSopenharmony_ci DEVICE_FIRST_UNLOCKED = 1, 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * The secret value in the Asset can only be accessed while the device is unlocked. 55961847f8eSopenharmony_ci * 56061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 56161847f8eSopenharmony_ci * @since 11 56261847f8eSopenharmony_ci */ 56361847f8eSopenharmony_ci DEVICE_UNLOCKED = 2, 56461847f8eSopenharmony_ci } 56561847f8eSopenharmony_ci 56661847f8eSopenharmony_ci /** 56761847f8eSopenharmony_ci * An enum type indicates the user authentication type for Asset access control. 56861847f8eSopenharmony_ci * 56961847f8eSopenharmony_ci * @enum { number } 57061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 57161847f8eSopenharmony_ci * @since 11 57261847f8eSopenharmony_ci */ 57361847f8eSopenharmony_ci enum AuthType { 57461847f8eSopenharmony_ci /** 57561847f8eSopenharmony_ci * The access to an Asset doesn't require user authentication. 57661847f8eSopenharmony_ci * 57761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 57861847f8eSopenharmony_ci * @since 11 57961847f8eSopenharmony_ci */ 58061847f8eSopenharmony_ci NONE = 0x00, 58161847f8eSopenharmony_ci /** 58261847f8eSopenharmony_ci * The access to an Asset requires user authentication using either PIN/pattern/password or biometric traits. 58361847f8eSopenharmony_ci * 58461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 58561847f8eSopenharmony_ci * @since 11 58661847f8eSopenharmony_ci */ 58761847f8eSopenharmony_ci ANY = 0xFF, 58861847f8eSopenharmony_ci } 58961847f8eSopenharmony_ci 59061847f8eSopenharmony_ci /** 59161847f8eSopenharmony_ci * An enum type indicates the type of Asset synchronization. 59261847f8eSopenharmony_ci * 59361847f8eSopenharmony_ci * @enum { number } 59461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 59561847f8eSopenharmony_ci * @since 11 59661847f8eSopenharmony_ci */ 59761847f8eSopenharmony_ci enum SyncType { 59861847f8eSopenharmony_ci /** 59961847f8eSopenharmony_ci * An Asset with this attribute value is never allowed to be transferred out. 60061847f8eSopenharmony_ci * 60161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 60261847f8eSopenharmony_ci * @since 11 60361847f8eSopenharmony_ci */ 60461847f8eSopenharmony_ci NEVER = 0, 60561847f8eSopenharmony_ci /** 60661847f8eSopenharmony_ci * An Asset with this attribute value can only be restored to the device from which it was transferred out. 60761847f8eSopenharmony_ci * 60861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 60961847f8eSopenharmony_ci * @since 11 61061847f8eSopenharmony_ci */ 61161847f8eSopenharmony_ci THIS_DEVICE = 1 << 0, 61261847f8eSopenharmony_ci /** 61361847f8eSopenharmony_ci * An Asset with this attribute value can only be transferred out to a trusted device (user authorized). 61461847f8eSopenharmony_ci * 61561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 61661847f8eSopenharmony_ci * @since 11 61761847f8eSopenharmony_ci */ 61861847f8eSopenharmony_ci TRUSTED_DEVICE = 1 << 1, 61961847f8eSopenharmony_ci /** 62061847f8eSopenharmony_ci * An Asset with this attribute value can only be transferred out to devices logged in with trusted accounts. 62161847f8eSopenharmony_ci * 62261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 62361847f8eSopenharmony_ci * @since 12 62461847f8eSopenharmony_ci */ 62561847f8eSopenharmony_ci TRUSTED_ACCOUNT = 1 << 2, 62661847f8eSopenharmony_ci } 62761847f8eSopenharmony_ci 62861847f8eSopenharmony_ci /** 62961847f8eSopenharmony_ci * An enum type indicates the strategy for conflict resolution when handling duplicated Asset alias. 63061847f8eSopenharmony_ci * 63161847f8eSopenharmony_ci * @enum { number } 63261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 63361847f8eSopenharmony_ci * @since 11 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci enum ConflictResolution { 63661847f8eSopenharmony_ci /** 63761847f8eSopenharmony_ci * Directly overwrite an Asset with duplicated alias when a conflict is detected. 63861847f8eSopenharmony_ci * 63961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 64061847f8eSopenharmony_ci * @since 11 64161847f8eSopenharmony_ci */ 64261847f8eSopenharmony_ci OVERWRITE = 0, 64361847f8eSopenharmony_ci /** 64461847f8eSopenharmony_ci * Throw an error so that the caller can take measures when a conflict is detected. 64561847f8eSopenharmony_ci * 64661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 64761847f8eSopenharmony_ci * @since 11 64861847f8eSopenharmony_ci */ 64961847f8eSopenharmony_ci THROW_ERROR = 1, 65061847f8eSopenharmony_ci } 65161847f8eSopenharmony_ci 65261847f8eSopenharmony_ci /** 65361847f8eSopenharmony_ci * An enum type indicates the return type of the queried Asset. 65461847f8eSopenharmony_ci * 65561847f8eSopenharmony_ci * @enum { number } 65661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 65761847f8eSopenharmony_ci * @since 11 65861847f8eSopenharmony_ci */ 65961847f8eSopenharmony_ci enum ReturnType { 66061847f8eSopenharmony_ci /** 66161847f8eSopenharmony_ci * Specify that the return data should contain both secret value and attributes. 66261847f8eSopenharmony_ci * 66361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 66461847f8eSopenharmony_ci * @since 11 66561847f8eSopenharmony_ci */ 66661847f8eSopenharmony_ci ALL = 0, 66761847f8eSopenharmony_ci /** 66861847f8eSopenharmony_ci * Specify that the return data contains only attributes. 66961847f8eSopenharmony_ci * 67061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 67161847f8eSopenharmony_ci * @since 11 67261847f8eSopenharmony_ci */ 67361847f8eSopenharmony_ci ATTRIBUTES = 1, 67461847f8eSopenharmony_ci } 67561847f8eSopenharmony_ci 67661847f8eSopenharmony_ci /** 67761847f8eSopenharmony_ci * An enum type indicates the additional action to be performed during operation. 67861847f8eSopenharmony_ci * 67961847f8eSopenharmony_ci * @enum { number } 68061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 68161847f8eSopenharmony_ci * @since 12 68261847f8eSopenharmony_ci */ 68361847f8eSopenharmony_ci enum OperationType { 68461847f8eSopenharmony_ci /** 68561847f8eSopenharmony_ci * Synchronization is required during operation. 68661847f8eSopenharmony_ci * 68761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 68861847f8eSopenharmony_ci * @since 12 68961847f8eSopenharmony_ci */ 69061847f8eSopenharmony_ci NEED_SYNC = 0, 69161847f8eSopenharmony_ci /** 69261847f8eSopenharmony_ci * Logout is required during operation. 69361847f8eSopenharmony_ci * 69461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 69561847f8eSopenharmony_ci * @since 12 69661847f8eSopenharmony_ci */ 69761847f8eSopenharmony_ci NEED_LOGOUT = 1, 69861847f8eSopenharmony_ci } 69961847f8eSopenharmony_ci 70061847f8eSopenharmony_ci /** 70161847f8eSopenharmony_ci * An enum type containing the data type definitions for Asset attribute value. 70261847f8eSopenharmony_ci * 70361847f8eSopenharmony_ci * @enum { number } 70461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 70561847f8eSopenharmony_ci * @since 11 70661847f8eSopenharmony_ci */ 70761847f8eSopenharmony_ci enum TagType { 70861847f8eSopenharmony_ci /** 70961847f8eSopenharmony_ci * The data type of Asset attribute value is bool. 71061847f8eSopenharmony_ci * 71161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 71261847f8eSopenharmony_ci * @since 11 71361847f8eSopenharmony_ci */ 71461847f8eSopenharmony_ci BOOL = 0x01 << 28, 71561847f8eSopenharmony_ci /** 71661847f8eSopenharmony_ci * The data type of Asset attribute value is uint32. 71761847f8eSopenharmony_ci * 71861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 71961847f8eSopenharmony_ci * @since 11 72061847f8eSopenharmony_ci */ 72161847f8eSopenharmony_ci NUMBER = 0x02 << 28, 72261847f8eSopenharmony_ci /** 72361847f8eSopenharmony_ci * The data type of Asset attribute value is byte array. 72461847f8eSopenharmony_ci * 72561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 72661847f8eSopenharmony_ci * @since 11 72761847f8eSopenharmony_ci */ 72861847f8eSopenharmony_ci BYTES = 0x03 << 28, 72961847f8eSopenharmony_ci } 73061847f8eSopenharmony_ci 73161847f8eSopenharmony_ci /** 73261847f8eSopenharmony_ci * An enum type containing the Asset attribute tags. 73361847f8eSopenharmony_ci * 73461847f8eSopenharmony_ci * @enum { number } 73561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 73661847f8eSopenharmony_ci * @since 11 73761847f8eSopenharmony_ci */ 73861847f8eSopenharmony_ci enum Tag { 73961847f8eSopenharmony_ci /** 74061847f8eSopenharmony_ci * A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens. 74161847f8eSopenharmony_ci * 74261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 74361847f8eSopenharmony_ci * @since 11 74461847f8eSopenharmony_ci */ 74561847f8eSopenharmony_ci SECRET = TagType.BYTES | 0x01, 74661847f8eSopenharmony_ci /** 74761847f8eSopenharmony_ci * A tag whose value is a byte array identifying an Asset. 74861847f8eSopenharmony_ci * 74961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 75061847f8eSopenharmony_ci * @since 11 75161847f8eSopenharmony_ci */ 75261847f8eSopenharmony_ci ALIAS = TagType.BYTES | 0x02, 75361847f8eSopenharmony_ci /** 75461847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed. 75561847f8eSopenharmony_ci * 75661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 75761847f8eSopenharmony_ci * @since 11 75861847f8eSopenharmony_ci */ 75961847f8eSopenharmony_ci ACCESSIBILITY = TagType.NUMBER | 0x03, 76061847f8eSopenharmony_ci /** 76161847f8eSopenharmony_ci * A tag whose value is a bool indicating whether a screen lock password is required for the device. 76261847f8eSopenharmony_ci * 76361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 76461847f8eSopenharmony_ci * @since 11 76561847f8eSopenharmony_ci */ 76661847f8eSopenharmony_ci REQUIRE_PASSWORD_SET = TagType.BOOL | 0x04, 76761847f8eSopenharmony_ci /** 76861847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control. 76961847f8eSopenharmony_ci * 77061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 77161847f8eSopenharmony_ci * @since 11 77261847f8eSopenharmony_ci */ 77361847f8eSopenharmony_ci AUTH_TYPE = TagType.NUMBER | 0x05, 77461847f8eSopenharmony_ci /** 77561847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication. 77661847f8eSopenharmony_ci * 77761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 77861847f8eSopenharmony_ci * @since 11 77961847f8eSopenharmony_ci */ 78061847f8eSopenharmony_ci AUTH_VALIDITY_PERIOD = TagType.NUMBER | 0x06, 78161847f8eSopenharmony_ci /** 78261847f8eSopenharmony_ci * A tag whose value is a byte array indicating the authentication challenge for anti-replay protection. 78361847f8eSopenharmony_ci * 78461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 78561847f8eSopenharmony_ci * @since 11 78661847f8eSopenharmony_ci */ 78761847f8eSopenharmony_ci AUTH_CHALLENGE = TagType.BYTES | 0x07, 78861847f8eSopenharmony_ci /** 78961847f8eSopenharmony_ci * A tag whose value is a byte array indicating the authentication token after a user is verified. 79061847f8eSopenharmony_ci * 79161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 79261847f8eSopenharmony_ci * @since 11 79361847f8eSopenharmony_ci */ 79461847f8eSopenharmony_ci AUTH_TOKEN = TagType.BYTES | 0x08, 79561847f8eSopenharmony_ci /** 79661847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization. 79761847f8eSopenharmony_ci * 79861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 79961847f8eSopenharmony_ci * @since 11 80061847f8eSopenharmony_ci */ 80161847f8eSopenharmony_ci SYNC_TYPE = TagType.NUMBER | 0x10, 80261847f8eSopenharmony_ci /** 80361847f8eSopenharmony_ci * A tag whose value is a bool indicating whether Asset is stored persistently. 80461847f8eSopenharmony_ci * 80561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 80661847f8eSopenharmony_ci * @since 11 80761847f8eSopenharmony_ci */ 80861847f8eSopenharmony_ci IS_PERSISTENT = TagType.BOOL | 0x11, 80961847f8eSopenharmony_ci /** 81061847f8eSopenharmony_ci * A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update). 81161847f8eSopenharmony_ci * 81261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 81361847f8eSopenharmony_ci * @since 11 81461847f8eSopenharmony_ci */ 81561847f8eSopenharmony_ci DATA_LABEL_CRITICAL_1 = TagType.BYTES | 0x20, 81661847f8eSopenharmony_ci /** 81761847f8eSopenharmony_ci * A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update). 81861847f8eSopenharmony_ci * 81961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 82061847f8eSopenharmony_ci * @since 11 82161847f8eSopenharmony_ci */ 82261847f8eSopenharmony_ci DATA_LABEL_CRITICAL_2 = TagType.BYTES | 0x21, 82361847f8eSopenharmony_ci /** 82461847f8eSopenharmony_ci * A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update). 82561847f8eSopenharmony_ci * 82661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 82761847f8eSopenharmony_ci * @since 11 82861847f8eSopenharmony_ci */ 82961847f8eSopenharmony_ci DATA_LABEL_CRITICAL_3 = TagType.BYTES | 0x22, 83061847f8eSopenharmony_ci /** 83161847f8eSopenharmony_ci * A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update). 83261847f8eSopenharmony_ci * 83361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 83461847f8eSopenharmony_ci * @since 11 83561847f8eSopenharmony_ci */ 83661847f8eSopenharmony_ci DATA_LABEL_CRITICAL_4 = TagType.BYTES | 0x23, 83761847f8eSopenharmony_ci /** 83861847f8eSopenharmony_ci * A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 83961847f8eSopenharmony_ci * 84061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 84161847f8eSopenharmony_ci * @since 11 84261847f8eSopenharmony_ci */ 84361847f8eSopenharmony_ci DATA_LABEL_NORMAL_1 = TagType.BYTES | 0x30, 84461847f8eSopenharmony_ci /** 84561847f8eSopenharmony_ci * A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 84661847f8eSopenharmony_ci * 84761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 84861847f8eSopenharmony_ci * @since 11 84961847f8eSopenharmony_ci */ 85061847f8eSopenharmony_ci DATA_LABEL_NORMAL_2 = TagType.BYTES | 0x31, 85161847f8eSopenharmony_ci /** 85261847f8eSopenharmony_ci * A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 85361847f8eSopenharmony_ci * 85461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 85561847f8eSopenharmony_ci * @since 11 85661847f8eSopenharmony_ci */ 85761847f8eSopenharmony_ci DATA_LABEL_NORMAL_3 = TagType.BYTES | 0x32, 85861847f8eSopenharmony_ci /** 85961847f8eSopenharmony_ci * A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 86061847f8eSopenharmony_ci * 86161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 86261847f8eSopenharmony_ci * @since 11 86361847f8eSopenharmony_ci */ 86461847f8eSopenharmony_ci DATA_LABEL_NORMAL_4 = TagType.BYTES | 0x33, 86561847f8eSopenharmony_ci /** 86661847f8eSopenharmony_ci * A local tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 86761847f8eSopenharmony_ci * The information of a local tag will not be synchronized. 86861847f8eSopenharmony_ci * 86961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 87061847f8eSopenharmony_ci * @since 12 87161847f8eSopenharmony_ci */ 87261847f8eSopenharmony_ci DATA_LABEL_NORMAL_LOCAL_1 = TagType.BYTES | 0x34, 87361847f8eSopenharmony_ci /** 87461847f8eSopenharmony_ci * A local tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 87561847f8eSopenharmony_ci * The information of a local tag will not be synchronized. 87661847f8eSopenharmony_ci * 87761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 87861847f8eSopenharmony_ci * @since 12 87961847f8eSopenharmony_ci */ 88061847f8eSopenharmony_ci DATA_LABEL_NORMAL_LOCAL_2 = TagType.BYTES | 0x35, 88161847f8eSopenharmony_ci /** 88261847f8eSopenharmony_ci * A local tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 88361847f8eSopenharmony_ci * The information of a local tag will not be synchronized. 88461847f8eSopenharmony_ci * 88561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 88661847f8eSopenharmony_ci * @since 12 88761847f8eSopenharmony_ci */ 88861847f8eSopenharmony_ci DATA_LABEL_NORMAL_LOCAL_3 = TagType.BYTES | 0x36, 88961847f8eSopenharmony_ci /** 89061847f8eSopenharmony_ci * A local tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 89161847f8eSopenharmony_ci * The information of a local tag will not be synchronized. 89261847f8eSopenharmony_ci * 89361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 89461847f8eSopenharmony_ci * @since 12 89561847f8eSopenharmony_ci */ 89661847f8eSopenharmony_ci DATA_LABEL_NORMAL_LOCAL_4 = TagType.BYTES | 0x37, 89761847f8eSopenharmony_ci /** 89861847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset. 89961847f8eSopenharmony_ci * 90061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 90161847f8eSopenharmony_ci * @since 11 90261847f8eSopenharmony_ci */ 90361847f8eSopenharmony_ci RETURN_TYPE = TagType.NUMBER | 0x40, 90461847f8eSopenharmony_ci /** 90561847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query. 90661847f8eSopenharmony_ci * 90761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 90861847f8eSopenharmony_ci * @since 11 90961847f8eSopenharmony_ci */ 91061847f8eSopenharmony_ci RETURN_LIMIT = TagType.NUMBER | 0x41, 91161847f8eSopenharmony_ci /** 91261847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query. 91361847f8eSopenharmony_ci * 91461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 91561847f8eSopenharmony_ci * @since 11 91661847f8eSopenharmony_ci */ 91761847f8eSopenharmony_ci RETURN_OFFSET = TagType.NUMBER | 0x42, 91861847f8eSopenharmony_ci /** 91961847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted. 92061847f8eSopenharmony_ci * 92161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 92261847f8eSopenharmony_ci * @since 11 92361847f8eSopenharmony_ci */ 92461847f8eSopenharmony_ci RETURN_ORDERED_BY = TagType.NUMBER | 0x43, 92561847f8eSopenharmony_ci /** 92661847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts. 92761847f8eSopenharmony_ci * 92861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 92961847f8eSopenharmony_ci * @since 11 93061847f8eSopenharmony_ci */ 93161847f8eSopenharmony_ci CONFLICT_RESOLUTION = TagType.NUMBER | 0x44, 93261847f8eSopenharmony_ci /** 93361847f8eSopenharmony_ci * A tag whose value is a byte array indicating the update time of an Asset. 93461847f8eSopenharmony_ci * 93561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 93661847f8eSopenharmony_ci * @since 12 93761847f8eSopenharmony_ci */ 93861847f8eSopenharmony_ci UPDATE_TIME = TagType.BYTES | 0x45, 93961847f8eSopenharmony_ci /** 94061847f8eSopenharmony_ci * A tag whose value is a 32-bit unsigned integer indicating the additional action to be performed during operation. 94161847f8eSopenharmony_ci * 94261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 94361847f8eSopenharmony_ci * @since 12 94461847f8eSopenharmony_ci */ 94561847f8eSopenharmony_ci OPERATION_TYPE = TagType.NUMBER | 0x46, 94661847f8eSopenharmony_ci /** 94761847f8eSopenharmony_ci * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted. 94861847f8eSopenharmony_ci * 94961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 95061847f8eSopenharmony_ci * @since 13 95161847f8eSopenharmony_ci */ 95261847f8eSopenharmony_ci REQUIRE_ATTR_ENCRYPTED = TagType.BOOL | 0x47, 95361847f8eSopenharmony_ci } 95461847f8eSopenharmony_ci 95561847f8eSopenharmony_ci /** 95661847f8eSopenharmony_ci * An enum type containing the Asset error codes. 95761847f8eSopenharmony_ci * 95861847f8eSopenharmony_ci * @enum { number } 95961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 96061847f8eSopenharmony_ci * @since 11 96161847f8eSopenharmony_ci */ 96261847f8eSopenharmony_ci enum ErrorCode { 96361847f8eSopenharmony_ci /** 96461847f8eSopenharmony_ci * The error code indicates that the caller doesn't have the permission. 96561847f8eSopenharmony_ci * 96661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 96761847f8eSopenharmony_ci * @since 11 96861847f8eSopenharmony_ci */ 96961847f8eSopenharmony_ci PERMISSION_DENIED = 201, 97061847f8eSopenharmony_ci /** 97161847f8eSopenharmony_ci * The error code indicates that the caller is not a system application. 97261847f8eSopenharmony_ci * 97361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 97461847f8eSopenharmony_ci * @since 12 97561847f8eSopenharmony_ci */ 97661847f8eSopenharmony_ci NOT_SYSTEM_APPLICATION = 202, 97761847f8eSopenharmony_ci /** 97861847f8eSopenharmony_ci * The error code indicates that the argument is invalid. 97961847f8eSopenharmony_ci * 98061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 98161847f8eSopenharmony_ci * @since 11 98261847f8eSopenharmony_ci */ 98361847f8eSopenharmony_ci INVALID_ARGUMENT = 401, 98461847f8eSopenharmony_ci /** 98561847f8eSopenharmony_ci * The error code indicates that the ASSET service is unavailable. 98661847f8eSopenharmony_ci * 98761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 98861847f8eSopenharmony_ci * @since 11 98961847f8eSopenharmony_ci */ 99061847f8eSopenharmony_ci SERVICE_UNAVAILABLE = 24000001, 99161847f8eSopenharmony_ci /** 99261847f8eSopenharmony_ci * The error code indicates that the asset is not found. 99361847f8eSopenharmony_ci * 99461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 99561847f8eSopenharmony_ci * @since 11 99661847f8eSopenharmony_ci */ 99761847f8eSopenharmony_ci NOT_FOUND = 24000002, 99861847f8eSopenharmony_ci /** 99961847f8eSopenharmony_ci * The error code indicates that the asset already exists. 100061847f8eSopenharmony_ci * 100161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 100261847f8eSopenharmony_ci * @since 11 100361847f8eSopenharmony_ci */ 100461847f8eSopenharmony_ci DUPLICATED = 24000003, 100561847f8eSopenharmony_ci /** 100661847f8eSopenharmony_ci * The error code indicates that access to the asset is denied. 100761847f8eSopenharmony_ci * 100861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 100961847f8eSopenharmony_ci * @since 11 101061847f8eSopenharmony_ci */ 101161847f8eSopenharmony_ci ACCESS_DENIED = 24000004, 101261847f8eSopenharmony_ci /** 101361847f8eSopenharmony_ci * The error code indicates that the screen lock status does not match. 101461847f8eSopenharmony_ci * 101561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 101661847f8eSopenharmony_ci * @since 11 101761847f8eSopenharmony_ci */ 101861847f8eSopenharmony_ci STATUS_MISMATCH = 24000005, 101961847f8eSopenharmony_ci /** 102061847f8eSopenharmony_ci * The error code indicates insufficient memory. 102161847f8eSopenharmony_ci * 102261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 102361847f8eSopenharmony_ci * @since 11 102461847f8eSopenharmony_ci */ 102561847f8eSopenharmony_ci OUT_OF_MEMORY = 24000006, 102661847f8eSopenharmony_ci /** 102761847f8eSopenharmony_ci * The error code indicates that the asset is corrupted. 102861847f8eSopenharmony_ci * 102961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 103061847f8eSopenharmony_ci * @since 11 103161847f8eSopenharmony_ci */ 103261847f8eSopenharmony_ci DATA_CORRUPTED = 24000007, 103361847f8eSopenharmony_ci /** 103461847f8eSopenharmony_ci * The error code indicates that the database operation failed. 103561847f8eSopenharmony_ci * 103661847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 103761847f8eSopenharmony_ci * @since 11 103861847f8eSopenharmony_ci */ 103961847f8eSopenharmony_ci DATABASE_ERROR = 24000008, 104061847f8eSopenharmony_ci /** 104161847f8eSopenharmony_ci * The error code indicates that the cryptography operation failed. 104261847f8eSopenharmony_ci * 104361847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 104461847f8eSopenharmony_ci * @since 11 104561847f8eSopenharmony_ci */ 104661847f8eSopenharmony_ci CRYPTO_ERROR = 24000009, 104761847f8eSopenharmony_ci /** 104861847f8eSopenharmony_ci * The error code indicates that the ipc failed. 104961847f8eSopenharmony_ci * 105061847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 105161847f8eSopenharmony_ci * @since 11 105261847f8eSopenharmony_ci */ 105361847f8eSopenharmony_ci IPC_ERROR = 24000010, 105461847f8eSopenharmony_ci /** 105561847f8eSopenharmony_ci * The error code indicates that calling the Bundle Manager service failed. 105661847f8eSopenharmony_ci * 105761847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 105861847f8eSopenharmony_ci * @since 11 105961847f8eSopenharmony_ci */ 106061847f8eSopenharmony_ci BMS_ERROR = 24000011, 106161847f8eSopenharmony_ci /** 106261847f8eSopenharmony_ci * The error code indicates that calling the OS Account service failed. 106361847f8eSopenharmony_ci * 106461847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 106561847f8eSopenharmony_ci * @since 11 106661847f8eSopenharmony_ci */ 106761847f8eSopenharmony_ci ACCOUNT_ERROR = 24000012, 106861847f8eSopenharmony_ci /** 106961847f8eSopenharmony_ci * The error code indicates that calling the Access Token service failed. 107061847f8eSopenharmony_ci * 107161847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 107261847f8eSopenharmony_ci * @since 11 107361847f8eSopenharmony_ci */ 107461847f8eSopenharmony_ci ACCESS_TOKEN_ERROR = 24000013, 107561847f8eSopenharmony_ci /** 107661847f8eSopenharmony_ci * The error code indicates that the file operation failed. 107761847f8eSopenharmony_ci * 107861847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 107961847f8eSopenharmony_ci * @since 11 108061847f8eSopenharmony_ci */ 108161847f8eSopenharmony_ci FILE_OPERATION_ERROR = 24000014, 108261847f8eSopenharmony_ci /** 108361847f8eSopenharmony_ci * The error code indicates that getting the system time failed. 108461847f8eSopenharmony_ci * 108561847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 108661847f8eSopenharmony_ci * @since 11 108761847f8eSopenharmony_ci */ 108861847f8eSopenharmony_ci GET_SYSTEM_TIME_ERROR = 24000015, 108961847f8eSopenharmony_ci /** 109061847f8eSopenharmony_ci * The error code indicates that the cache exceeds the limit. 109161847f8eSopenharmony_ci * 109261847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 109361847f8eSopenharmony_ci * @since 11 109461847f8eSopenharmony_ci */ 109561847f8eSopenharmony_ci LIMIT_EXCEEDED = 24000016, 109661847f8eSopenharmony_ci /** 109761847f8eSopenharmony_ci * The error code indicates that the capability is not supported. 109861847f8eSopenharmony_ci * 109961847f8eSopenharmony_ci * @syscap SystemCapability.Security.Asset 110061847f8eSopenharmony_ci * @since 11 110161847f8eSopenharmony_ci */ 110261847f8eSopenharmony_ci UNSUPPORTED = 24000017, 110361847f8eSopenharmony_ci } 110461847f8eSopenharmony_ci} 110561847f8eSopenharmony_ci 110661847f8eSopenharmony_ciexport default asset; 1107