• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit CoreFileKit
19 */
20
21/**
22 * Provides filesystem KeyManager APIs.
23 *
24 * @namespace keyManager
25 * @syscap SystemCapability.FileManagement.StorageService.Encryption
26 * @since 15
27 */
28declare namespace keyManager {
29   /**
30    * Initiate the deactivation of user key for the specified user when user screen is locked.
31    *
32    * @permission ohos.permission.STORAGE_MANAGER_CRYPT
33    * @param { number } userId
34    * @throws { BusinessError } 201 - Permission verification failed.
35    * @throws { BusinessError } 202 - The caller is not a system application.
36    * @throws { BusinessError } 401 - The input parameter is invalid. Possible causes: Mandatory
37 parameters are left unspecified; Or input parameter has type different from the type the interface requires.
38    * @throws { BusinessError } 13600001 - IPC error.
39    * @throws { BusinessError } 13600008 - No such object. Possible causes: Cannot find userkey for the specified user.
40    * @throws { BusinessError } 13600009 - User ID out of range. Possible causes: input parameter userId < 100 or userId > 10736.
41    * @syscap SystemCapability.FileManagement.StorageService.Encryption
42    * @systemapi
43    * @since 15
44    */
45   function deactivateUserKey(userId: number):void;
46 }
47
48 export default keyManager;