• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #ifndef IUSERIDM_H
17 #define IUSERIDM_H
18 
19 #include "iuseridm_callback.h"
20 
21 namespace OHOS {
22 namespace UserIAM {
23 namespace UserIDM {
24 class IUserIDM : public IRemoteBroker {
25 public:
26     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.useridm.IUserIDM");
27     virtual uint64_t OpenSession() = 0;
28     virtual void CloseSession() = 0;
29     virtual int32_t GetAuthInfo(AuthType authType, const sptr<IGetInfoCallback>& callback) = 0;
30     virtual int32_t GetAuthInfo(int32_t userId, AuthType authType, const sptr<IGetInfoCallback>& callback) = 0;
31     virtual int32_t GetSecInfo(int32_t userId, const sptr<IGetSecInfoCallback>& callback) = 0;
32     virtual void AddCredential(AddCredInfo& credInfo, const sptr<IIDMCallback>& callback) = 0;
33     virtual void UpdateCredential(AddCredInfo& credInfo, const sptr<IIDMCallback>& callback) = 0;
34     virtual int32_t Cancel(uint64_t challenge) = 0;
35     virtual int32_t EnforceDelUser(int32_t userId, const sptr<IIDMCallback>& callback) = 0;
36     virtual void DelUser(std::vector<uint8_t> authToken, const sptr<IIDMCallback>& callback) = 0;
37     virtual void DelCred(uint64_t credentialId, std::vector<uint8_t> authToken, const sptr<IIDMCallback>& callback) = 0;
38 
39     enum {
40         USERIDM_OPEN_SESSION = 0,
41         USERIDM_CLOSE_SESSION,
42         USERIDM_GET_AUTH_INFO,
43         USERIDM_GET_AUTH_INFO_BY_ID,
44         USERIDM_GET_SEC_INFO,
45         USERIDM_ADD_CREDENTIAL,
46         USERIDM_UPDATE_CREDENTIAL,
47         USERIDM_CANCEL,
48         USERIDM_ENFORCE_DELUSER,
49         USERIDM_DELUSER,
50         USERIDM_DELCRED,
51     };
52 };
53 }  // namespace UserIDM
54 }  // namespace UserIAM
55 }  // namespace OHOS
56 
57 #endif // IUSERIDM_H
58