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 strategy for conflict resolution when handling duplicated Asset alias. 1030 * 1031 * @enum { number } 1032 * @syscap SystemCapability.Security.Asset 1033 * @since 11 1034 */ 1035 /** 1036 * An enum type indicates the strategy for conflict resolution when handling duplicated Asset alias. 1037 * 1038 * @enum { number } 1039 * @syscap SystemCapability.Security.Asset 1040 * @atomicservice 1041 * @since 14 1042 */ 1043 enum ConflictResolution { 1044 /** 1045 * Directly overwrite an Asset with duplicated alias when a conflict is detected. 1046 * 1047 * @syscap SystemCapability.Security.Asset 1048 * @since 11 1049 */ 1050 /** 1051 * Directly overwrite an Asset with duplicated alias when a conflict is detected. 1052 * 1053 * @syscap SystemCapability.Security.Asset 1054 * @atomicservice 1055 * @since 14 1056 */ 1057 OVERWRITE = 0, 1058 /** 1059 * Throw an error so that the caller can take measures when a conflict is detected. 1060 * 1061 * @syscap SystemCapability.Security.Asset 1062 * @since 11 1063 */ 1064 /** 1065 * Throw an error so that the caller can take measures when a conflict is detected. 1066 * 1067 * @syscap SystemCapability.Security.Asset 1068 * @atomicservice 1069 * @since 14 1070 */ 1071 THROW_ERROR = 1, 1072 } 1073 1074 /** 1075 * An enum type indicates the return type of the queried Asset. 1076 * 1077 * @enum { number } 1078 * @syscap SystemCapability.Security.Asset 1079 * @since 11 1080 */ 1081 /** 1082 * An enum type indicates the return type of the queried Asset. 1083 * 1084 * @enum { number } 1085 * @syscap SystemCapability.Security.Asset 1086 * @atomicservice 1087 * @since 14 1088 */ 1089 enum ReturnType { 1090 /** 1091 * Specify that the return data should contain both secret value and attributes. 1092 * 1093 * @syscap SystemCapability.Security.Asset 1094 * @since 11 1095 */ 1096 /** 1097 * Specify that the return data should contain both secret value and attributes. 1098 * 1099 * @syscap SystemCapability.Security.Asset 1100 * @atomicservice 1101 * @since 14 1102 */ 1103 ALL = 0, 1104 /** 1105 * Specify that the return data contains only attributes. 1106 * 1107 * @syscap SystemCapability.Security.Asset 1108 * @since 11 1109 */ 1110 /** 1111 * Specify that the return data contains only attributes. 1112 * 1113 * @syscap SystemCapability.Security.Asset 1114 * @atomicservice 1115 * @since 14 1116 */ 1117 ATTRIBUTES = 1, 1118 } 1119 1120 /** 1121 * An enum type indicates the additional action to be performed during operation. 1122 * 1123 * @enum { number } 1124 * @syscap SystemCapability.Security.Asset 1125 * @since 12 1126 */ 1127 enum OperationType { 1128 /** 1129 * Synchronization is required during operation. 1130 * 1131 * @syscap SystemCapability.Security.Asset 1132 * @since 12 1133 */ 1134 NEED_SYNC = 0, 1135 /** 1136 * Logout is required during operation. 1137 * 1138 * @syscap SystemCapability.Security.Asset 1139 * @since 12 1140 */ 1141 NEED_LOGOUT = 1, 1142 } 1143 1144 /** 1145 * An enum type containing the data type definitions for Asset attribute value. 1146 * 1147 * @enum { number } 1148 * @syscap SystemCapability.Security.Asset 1149 * @since 11 1150 */ 1151 /** 1152 * An enum type containing the data type definitions for Asset attribute value. 1153 * 1154 * @enum { number } 1155 * @syscap SystemCapability.Security.Asset 1156 * @atomicservice 1157 * @since 14 1158 */ 1159 enum TagType { 1160 /** 1161 * The data type of Asset attribute value is bool. 1162 * 1163 * @syscap SystemCapability.Security.Asset 1164 * @since 11 1165 */ 1166 /** 1167 * The data type of Asset attribute value is bool. 1168 * 1169 * @syscap SystemCapability.Security.Asset 1170 * @atomicservice 1171 * @since 14 1172 */ 1173 BOOL = 0x01 << 28, 1174 /** 1175 * The data type of Asset attribute value is uint32. 1176 * 1177 * @syscap SystemCapability.Security.Asset 1178 * @since 11 1179 */ 1180 /** 1181 * The data type of Asset attribute value is uint32. 1182 * 1183 * @syscap SystemCapability.Security.Asset 1184 * @atomicservice 1185 * @since 14 1186 */ 1187 NUMBER = 0x02 << 28, 1188 /** 1189 * The data type of Asset attribute value is byte array. 1190 * 1191 * @syscap SystemCapability.Security.Asset 1192 * @since 11 1193 */ 1194 /** 1195 * The data type of Asset attribute value is byte array. 1196 * 1197 * @syscap SystemCapability.Security.Asset 1198 * @atomicservice 1199 * @since 14 1200 */ 1201 BYTES = 0x03 << 28, 1202 } 1203 1204 /** 1205 * An enum type containing the Asset attribute tags. 1206 * 1207 * @enum { number } 1208 * @syscap SystemCapability.Security.Asset 1209 * @since 11 1210 */ 1211 /** 1212 * An enum type containing the Asset attribute tags. 1213 * 1214 * @enum { number } 1215 * @syscap SystemCapability.Security.Asset 1216 * @atomicservice 1217 * @since 14 1218 */ 1219 enum Tag { 1220 /** 1221 * A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens. 1222 * 1223 * @syscap SystemCapability.Security.Asset 1224 * @since 11 1225 */ 1226 /** 1227 * A tag whose value is a byte array indicating the sensitive user data such as passwords and tokens. 1228 * 1229 * @syscap SystemCapability.Security.Asset 1230 * @atomicservice 1231 * @since 14 1232 */ 1233 SECRET = TagType.BYTES | 0x01, 1234 /** 1235 * A tag whose value is a byte array identifying an Asset. 1236 * 1237 * @syscap SystemCapability.Security.Asset 1238 * @since 11 1239 */ 1240 /** 1241 * A tag whose value is a byte array identifying an Asset. 1242 * 1243 * @syscap SystemCapability.Security.Asset 1244 * @atomicservice 1245 * @since 14 1246 */ 1247 ALIAS = TagType.BYTES | 0x02, 1248 /** 1249 * A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed. 1250 * 1251 * @syscap SystemCapability.Security.Asset 1252 * @since 11 1253 */ 1254 /** 1255 * A tag whose value is a 32-bit unsigned integer indicating when the Asset can be accessed. 1256 * 1257 * @syscap SystemCapability.Security.Asset 1258 * @atomicservice 1259 * @since 14 1260 */ 1261 ACCESSIBILITY = TagType.NUMBER | 0x03, 1262 /** 1263 * A tag whose value is a bool indicating whether a screen lock password is required for the device. 1264 * 1265 * @syscap SystemCapability.Security.Asset 1266 * @since 11 1267 */ 1268 /** 1269 * A tag whose value is a bool indicating whether a screen lock password is required for the device. 1270 * 1271 * @syscap SystemCapability.Security.Asset 1272 * @atomicservice 1273 * @since 14 1274 */ 1275 REQUIRE_PASSWORD_SET = TagType.BOOL | 0x04, 1276 /** 1277 * A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control. 1278 * 1279 * @syscap SystemCapability.Security.Asset 1280 * @since 11 1281 */ 1282 /** 1283 * A tag whose value is a 32-bit unsigned integer indicating the user authentication type for Asset access control. 1284 * 1285 * @syscap SystemCapability.Security.Asset 1286 * @atomicservice 1287 * @since 14 1288 */ 1289 AUTH_TYPE = TagType.NUMBER | 0x05, 1290 /** 1291 * A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication. 1292 * 1293 * @syscap SystemCapability.Security.Asset 1294 * @since 11 1295 */ 1296 /** 1297 * A tag whose value is a 32-bit unsigned integer indicating the validity period in seconds of user authentication. 1298 * 1299 * @syscap SystemCapability.Security.Asset 1300 * @atomicservice 1301 * @since 14 1302 */ 1303 AUTH_VALIDITY_PERIOD = TagType.NUMBER | 0x06, 1304 /** 1305 * A tag whose value is a byte array indicating the authentication challenge for anti-replay protection. 1306 * 1307 * @syscap SystemCapability.Security.Asset 1308 * @since 11 1309 */ 1310 /** 1311 * A tag whose value is a byte array indicating the authentication challenge for anti-replay protection. 1312 * 1313 * @syscap SystemCapability.Security.Asset 1314 * @atomicservice 1315 * @since 14 1316 */ 1317 AUTH_CHALLENGE = TagType.BYTES | 0x07, 1318 /** 1319 * A tag whose value is a byte array indicating the authentication token after a user is verified. 1320 * 1321 * @syscap SystemCapability.Security.Asset 1322 * @since 11 1323 */ 1324 /** 1325 * A tag whose value is a byte array indicating the authentication token after a user is verified. 1326 * 1327 * @syscap SystemCapability.Security.Asset 1328 * @atomicservice 1329 * @since 14 1330 */ 1331 AUTH_TOKEN = TagType.BYTES | 0x08, 1332 /** 1333 * A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization. 1334 * 1335 * @syscap SystemCapability.Security.Asset 1336 * @since 11 1337 */ 1338 /** 1339 * A tag whose value is a 32-bit unsigned integer indicating the type of Asset synchronization. 1340 * 1341 * @syscap SystemCapability.Security.Asset 1342 * @atomicservice 1343 * @since 14 1344 */ 1345 SYNC_TYPE = TagType.NUMBER | 0x10, 1346 /** 1347 * A tag whose value is a bool indicating whether Asset is stored persistently. 1348 * 1349 * @syscap SystemCapability.Security.Asset 1350 * @since 11 1351 */ 1352 IS_PERSISTENT = TagType.BOOL | 0x11, 1353 /** 1354 * A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update). 1355 * 1356 * @syscap SystemCapability.Security.Asset 1357 * @since 11 1358 */ 1359 /** 1360 * A tag whose value is a byte array indicating the first user-defined Asset data label (not allow to update). 1361 * 1362 * @syscap SystemCapability.Security.Asset 1363 * @atomicservice 1364 * @since 14 1365 */ 1366 DATA_LABEL_CRITICAL_1 = TagType.BYTES | 0x20, 1367 /** 1368 * A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update). 1369 * 1370 * @syscap SystemCapability.Security.Asset 1371 * @since 11 1372 */ 1373 /** 1374 * A tag whose value is a byte array indicating the second user-defined Asset data label (not allow to update). 1375 * 1376 * @syscap SystemCapability.Security.Asset 1377 * @atomicservice 1378 * @since 14 1379 */ 1380 DATA_LABEL_CRITICAL_2 = TagType.BYTES | 0x21, 1381 /** 1382 * A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update). 1383 * 1384 * @syscap SystemCapability.Security.Asset 1385 * @since 11 1386 */ 1387 /** 1388 * A tag whose value is a byte array indicating the third user-defined Asset data label (not allow to update). 1389 * 1390 * @syscap SystemCapability.Security.Asset 1391 * @atomicservice 1392 * @since 14 1393 */ 1394 DATA_LABEL_CRITICAL_3 = TagType.BYTES | 0x22, 1395 /** 1396 * A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update). 1397 * 1398 * @syscap SystemCapability.Security.Asset 1399 * @since 11 1400 */ 1401 /** 1402 * A tag whose value is a byte array indicating the fourth user-defined Asset data label (not allow to update). 1403 * 1404 * @syscap SystemCapability.Security.Asset 1405 * @atomicservice 1406 * @since 14 1407 */ 1408 DATA_LABEL_CRITICAL_4 = TagType.BYTES | 0x23, 1409 /** 1410 * A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 1411 * 1412 * @syscap SystemCapability.Security.Asset 1413 * @since 11 1414 */ 1415 /** 1416 * A tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 1417 * 1418 * @syscap SystemCapability.Security.Asset 1419 * @atomicservice 1420 * @since 14 1421 */ 1422 DATA_LABEL_NORMAL_1 = TagType.BYTES | 0x30, 1423 /** 1424 * A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 1425 * 1426 * @syscap SystemCapability.Security.Asset 1427 * @since 11 1428 */ 1429 /** 1430 * A tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 1431 * 1432 * @syscap SystemCapability.Security.Asset 1433 * @atomicservice 1434 * @since 14 1435 */ 1436 DATA_LABEL_NORMAL_2 = TagType.BYTES | 0x31, 1437 /** 1438 * A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 1439 * 1440 * @syscap SystemCapability.Security.Asset 1441 * @since 11 1442 */ 1443 /** 1444 * A tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 1445 * 1446 * @syscap SystemCapability.Security.Asset 1447 * @atomicservice 1448 * @since 14 1449 */ 1450 DATA_LABEL_NORMAL_3 = TagType.BYTES | 0x32, 1451 /** 1452 * A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 1453 * 1454 * @syscap SystemCapability.Security.Asset 1455 * @since 11 1456 */ 1457 /** 1458 * A tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 1459 * 1460 * @syscap SystemCapability.Security.Asset 1461 * @atomicservice 1462 * @since 14 1463 */ 1464 DATA_LABEL_NORMAL_4 = TagType.BYTES | 0x33, 1465 /** 1466 * A local tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 1467 * The information of a local tag will not be synchronized. 1468 * 1469 * @syscap SystemCapability.Security.Asset 1470 * @since 12 1471 */ 1472 /** 1473 * A local tag whose value is a byte array indicating the first user-defined Asset data label (allow to update). 1474 * The information of a local tag will not be synchronized. 1475 * 1476 * @syscap SystemCapability.Security.Asset 1477 * @atomicservice 1478 * @since 14 1479 */ 1480 DATA_LABEL_NORMAL_LOCAL_1 = TagType.BYTES | 0x34, 1481 /** 1482 * A local tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 1483 * The information of a local tag will not be synchronized. 1484 * 1485 * @syscap SystemCapability.Security.Asset 1486 * @since 12 1487 */ 1488 /** 1489 * A local tag whose value is a byte array indicating the second user-defined Asset data label (allow to update). 1490 * The information of a local tag will not be synchronized. 1491 * 1492 * @syscap SystemCapability.Security.Asset 1493 * @atomicservice 1494 * @since 14 1495 */ 1496 DATA_LABEL_NORMAL_LOCAL_2 = TagType.BYTES | 0x35, 1497 /** 1498 * A local tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 1499 * The information of a local tag will not be synchronized. 1500 * 1501 * @syscap SystemCapability.Security.Asset 1502 * @since 12 1503 */ 1504 /** 1505 * A local tag whose value is a byte array indicating the third user-defined Asset data label (allow to update). 1506 * The information of a local tag will not be synchronized. 1507 * 1508 * @syscap SystemCapability.Security.Asset 1509 * @atomicservice 1510 * @since 14 1511 */ 1512 DATA_LABEL_NORMAL_LOCAL_3 = TagType.BYTES | 0x36, 1513 /** 1514 * A local tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 1515 * The information of a local tag will not be synchronized. 1516 * 1517 * @syscap SystemCapability.Security.Asset 1518 * @since 12 1519 */ 1520 /** 1521 * A local tag whose value is a byte array indicating the fourth user-defined Asset data label (allow to update). 1522 * The information of a local tag will not be synchronized. 1523 * 1524 * @syscap SystemCapability.Security.Asset 1525 * @atomicservice 1526 * @since 14 1527 */ 1528 DATA_LABEL_NORMAL_LOCAL_4 = TagType.BYTES | 0x37, 1529 /** 1530 * A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset. 1531 * 1532 * @syscap SystemCapability.Security.Asset 1533 * @since 11 1534 */ 1535 /** 1536 * A tag whose value is a 32-bit unsigned integer indicating the return type of the queried Asset. 1537 * 1538 * @syscap SystemCapability.Security.Asset 1539 * @atomicservice 1540 * @since 14 1541 */ 1542 RETURN_TYPE = TagType.NUMBER | 0x40, 1543 /** 1544 * A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query. 1545 * 1546 * @syscap SystemCapability.Security.Asset 1547 * @since 11 1548 */ 1549 /** 1550 * A tag whose value is a 32-bit unsigned integer indicating the maximum number of returned Assets in one query. 1551 * 1552 * @syscap SystemCapability.Security.Asset 1553 * @atomicservice 1554 * @since 14 1555 */ 1556 RETURN_LIMIT = TagType.NUMBER | 0x41, 1557 /** 1558 * A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query. 1559 * 1560 * @syscap SystemCapability.Security.Asset 1561 * @since 11 1562 */ 1563 /** 1564 * A tag whose value is a 32-bit unsigned integer indicating the offset of return data in batch query. 1565 * 1566 * @syscap SystemCapability.Security.Asset 1567 * @atomicservice 1568 * @since 14 1569 */ 1570 RETURN_OFFSET = TagType.NUMBER | 0x42, 1571 /** 1572 * A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted. 1573 * 1574 * @syscap SystemCapability.Security.Asset 1575 * @since 11 1576 */ 1577 /** 1578 * A tag whose value is a 32-bit unsigned integer indicating how the query results are sorted. 1579 * 1580 * @syscap SystemCapability.Security.Asset 1581 * @atomicservice 1582 * @since 14 1583 */ 1584 RETURN_ORDERED_BY = TagType.NUMBER | 0x43, 1585 /** 1586 * A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts. 1587 * 1588 * @syscap SystemCapability.Security.Asset 1589 * @since 11 1590 */ 1591 /** 1592 * A tag whose value is a 32-bit unsigned integer indicating the strategy for resolving Asset conflicts. 1593 * 1594 * @syscap SystemCapability.Security.Asset 1595 * @atomicservice 1596 * @since 14 1597 */ 1598 CONFLICT_RESOLUTION = TagType.NUMBER | 0x44, 1599 /** 1600 * A tag whose value is a byte array indicating the update time of an Asset. 1601 * 1602 * @syscap SystemCapability.Security.Asset 1603 * @since 12 1604 */ 1605 /** 1606 * A tag whose value is a byte array indicating the update time of an Asset. 1607 * 1608 * @syscap SystemCapability.Security.Asset 1609 * @atomicservice 1610 * @since 14 1611 */ 1612 UPDATE_TIME = TagType.BYTES | 0x45, 1613 /** 1614 * A tag whose value is a 32-bit unsigned integer indicating the additional action to be performed during operation. 1615 * 1616 * @syscap SystemCapability.Security.Asset 1617 * @since 12 1618 */ 1619 OPERATION_TYPE = TagType.NUMBER | 0x46, 1620 /** 1621 * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted. 1622 * 1623 * @syscap SystemCapability.Security.Asset 1624 * @atomicservice 1625 * @since 14 1626 */ 1627 REQUIRE_ATTR_ENCRYPTED = TagType.BOOL | 0x47, 1628 } 1629 1630 /** 1631 * An enum type containing the Asset error codes. 1632 * 1633 * @enum { number } 1634 * @syscap SystemCapability.Security.Asset 1635 * @since 11 1636 */ 1637 /** 1638 * An enum type containing the Asset error codes. 1639 * 1640 * @enum { number } 1641 * @syscap SystemCapability.Security.Asset 1642 * @atomicservice 1643 * @since 14 1644 */ 1645 enum ErrorCode { 1646 /** 1647 * The error code indicates that the caller doesn't have the permission. 1648 * 1649 * @syscap SystemCapability.Security.Asset 1650 * @since 11 1651 */ 1652 PERMISSION_DENIED = 201, 1653 /** 1654 * The error code indicates that the caller is not a system application. 1655 * 1656 * @syscap SystemCapability.Security.Asset 1657 * @since 12 1658 */ 1659 NOT_SYSTEM_APPLICATION = 202, 1660 /** 1661 * The error code indicates that the argument is invalid. 1662 * 1663 * @syscap SystemCapability.Security.Asset 1664 * @since 11 1665 */ 1666 /** 1667 * The error code indicates that the argument is invalid. 1668 * 1669 * @syscap SystemCapability.Security.Asset 1670 * @atomicservice 1671 * @since 14 1672 */ 1673 INVALID_ARGUMENT = 401, 1674 /** 1675 * The error code indicates that the ASSET service is unavailable. 1676 * 1677 * @syscap SystemCapability.Security.Asset 1678 * @since 11 1679 */ 1680 /** 1681 * The error code indicates that the ASSET service is unavailable. 1682 * 1683 * @syscap SystemCapability.Security.Asset 1684 * @atomicservice 1685 * @since 14 1686 */ 1687 SERVICE_UNAVAILABLE = 24000001, 1688 /** 1689 * The error code indicates that the asset is not found. 1690 * 1691 * @syscap SystemCapability.Security.Asset 1692 * @since 11 1693 */ 1694 /** 1695 * The error code indicates that the asset is not found. 1696 * 1697 * @syscap SystemCapability.Security.Asset 1698 * @atomicservice 1699 * @since 14 1700 */ 1701 NOT_FOUND = 24000002, 1702 /** 1703 * The error code indicates that the asset already exists. 1704 * 1705 * @syscap SystemCapability.Security.Asset 1706 * @since 11 1707 */ 1708 /** 1709 * The error code indicates that the asset already exists. 1710 * 1711 * @syscap SystemCapability.Security.Asset 1712 * @atomicservice 1713 * @since 14 1714 */ 1715 DUPLICATED = 24000003, 1716 /** 1717 * The error code indicates that access to the asset is denied. 1718 * 1719 * @syscap SystemCapability.Security.Asset 1720 * @since 11 1721 */ 1722 /** 1723 * The error code indicates that access to the asset is denied. 1724 * 1725 * @syscap SystemCapability.Security.Asset 1726 * @atomicservice 1727 * @since 14 1728 */ 1729 ACCESS_DENIED = 24000004, 1730 /** 1731 * The error code indicates that the screen lock status does not match. 1732 * 1733 * @syscap SystemCapability.Security.Asset 1734 * @since 11 1735 */ 1736 /** 1737 * The error code indicates that the screen lock status does not match. 1738 * 1739 * @syscap SystemCapability.Security.Asset 1740 * @atomicservice 1741 * @since 14 1742 */ 1743 STATUS_MISMATCH = 24000005, 1744 /** 1745 * The error code indicates insufficient memory. 1746 * 1747 * @syscap SystemCapability.Security.Asset 1748 * @since 11 1749 */ 1750 /** 1751 * The error code indicates insufficient memory. 1752 * 1753 * @syscap SystemCapability.Security.Asset 1754 * @atomicservice 1755 * @since 14 1756 */ 1757 OUT_OF_MEMORY = 24000006, 1758 /** 1759 * The error code indicates that the asset is corrupted. 1760 * 1761 * @syscap SystemCapability.Security.Asset 1762 * @since 11 1763 */ 1764 /** 1765 * The error code indicates that the asset is corrupted. 1766 * 1767 * @syscap SystemCapability.Security.Asset 1768 * @atomicservice 1769 * @since 14 1770 */ 1771 DATA_CORRUPTED = 24000007, 1772 /** 1773 * The error code indicates that the database operation failed. 1774 * 1775 * @syscap SystemCapability.Security.Asset 1776 * @since 11 1777 */ 1778 /** 1779 * The error code indicates that the database operation failed. 1780 * 1781 * @syscap SystemCapability.Security.Asset 1782 * @atomicservice 1783 * @since 14 1784 */ 1785 DATABASE_ERROR = 24000008, 1786 /** 1787 * The error code indicates that the cryptography operation failed. 1788 * 1789 * @syscap SystemCapability.Security.Asset 1790 * @since 11 1791 */ 1792 /** 1793 * The error code indicates that the cryptography operation failed. 1794 * 1795 * @syscap SystemCapability.Security.Asset 1796 * @atomicservice 1797 * @since 14 1798 */ 1799 CRYPTO_ERROR = 24000009, 1800 /** 1801 * The error code indicates that the ipc failed. 1802 * 1803 * @syscap SystemCapability.Security.Asset 1804 * @since 11 1805 */ 1806 /** 1807 * The error code indicates that the ipc failed. 1808 * 1809 * @syscap SystemCapability.Security.Asset 1810 * @atomicservice 1811 * @since 14 1812 */ 1813 IPC_ERROR = 24000010, 1814 /** 1815 * The error code indicates that calling the Bundle Manager service failed. 1816 * 1817 * @syscap SystemCapability.Security.Asset 1818 * @since 11 1819 */ 1820 /** 1821 * The error code indicates that calling the Bundle Manager service failed. 1822 * 1823 * @syscap SystemCapability.Security.Asset 1824 * @atomicservice 1825 * @since 14 1826 */ 1827 BMS_ERROR = 24000011, 1828 /** 1829 * The error code indicates that calling the OS Account service failed. 1830 * 1831 * @syscap SystemCapability.Security.Asset 1832 * @since 11 1833 */ 1834 /** 1835 * The error code indicates that calling the OS Account service failed. 1836 * 1837 * @syscap SystemCapability.Security.Asset 1838 * @atomicservice 1839 * @since 14 1840 */ 1841 ACCOUNT_ERROR = 24000012, 1842 /** 1843 * The error code indicates that calling the Access Token service failed. 1844 * 1845 * @syscap SystemCapability.Security.Asset 1846 * @since 11 1847 */ 1848 /** 1849 * The error code indicates that calling the Access Token service failed. 1850 * 1851 * @syscap SystemCapability.Security.Asset 1852 * @atomicservice 1853 * @since 14 1854 */ 1855 ACCESS_TOKEN_ERROR = 24000013, 1856 /** 1857 * The error code indicates that the file operation failed. 1858 * 1859 * @syscap SystemCapability.Security.Asset 1860 * @since 11 1861 */ 1862 /** 1863 * The error code indicates that the file operation failed. 1864 * 1865 * @syscap SystemCapability.Security.Asset 1866 * @atomicservice 1867 * @since 14 1868 */ 1869 FILE_OPERATION_ERROR = 24000014, 1870 /** 1871 * The error code indicates that getting the system time failed. 1872 * 1873 * @syscap SystemCapability.Security.Asset 1874 * @since 11 1875 */ 1876 /** 1877 * The error code indicates that getting the system time failed. 1878 * 1879 * @syscap SystemCapability.Security.Asset 1880 * @atomicservice 1881 * @since 14 1882 */ 1883 GET_SYSTEM_TIME_ERROR = 24000015, 1884 /** 1885 * The error code indicates that the cache exceeds the limit. 1886 * 1887 * @syscap SystemCapability.Security.Asset 1888 * @since 11 1889 */ 1890 /** 1891 * The error code indicates that the cache exceeds the limit. 1892 * 1893 * @syscap SystemCapability.Security.Asset 1894 * @atomicservice 1895 * @since 14 1896 */ 1897 LIMIT_EXCEEDED = 24000016, 1898 /** 1899 * The error code indicates that the capability is not supported. 1900 * 1901 * @syscap SystemCapability.Security.Asset 1902 * @since 11 1903 */ 1904 /** 1905 * The error code indicates that the capability is not supported. 1906 * 1907 * @syscap SystemCapability.Security.Asset 1908 * @atomicservice 1909 * @since 14 1910 */ 1911 UNSUPPORTED = 24000017, 1912 } 1913} 1914 1915export default asset; 1916