• 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 USER_IDM_CLIENT_IMPL_H
17 #define USER_IDM_CLIENT_IMPL_H
18 
19 #include "nocopyable.h"
20 
21 #include "user_idm_client.h"
22 #include "user_idm_interface.h"
23 
24 namespace OHOS {
25 namespace UserIam {
26 namespace UserAuth {
27 class UserIdmClientImpl final : public UserIdmClient, public NoCopyable {
28 public:
29     std::vector<uint8_t> OpenSession(int32_t userId) override;
30     void CloseSession(int32_t userId) override;
31     void AddCredential(int32_t userId, const CredentialParameters &para,
32         const std::shared_ptr<UserIdmClientCallback> &callback) override;
33     void UpdateCredential(int32_t userId, const CredentialParameters &para,
34         const std::shared_ptr<UserIdmClientCallback> &callback) override;
35     int32_t Cancel(int32_t userId) override;
36     void DeleteCredential(int32_t userId, uint64_t credentialId, const std::vector<uint8_t> &authToken,
37         const std::shared_ptr<UserIdmClientCallback> &callback) override;
38     void DeleteUser(int32_t userId, const std::vector<uint8_t> &authToken,
39         const std::shared_ptr<UserIdmClientCallback> &callback) override;
40     int32_t EraseUser(int32_t userId, const std::shared_ptr<UserIdmClientCallback> &callback) override;
41     int32_t GetCredentialInfo(int32_t userId, AuthType authType,
42         const std::shared_ptr<GetCredentialInfoCallback> &callback) override;
43     int32_t GetSecUserInfo(int32_t userId, const std::shared_ptr<GetSecUserInfoCallback> &callback) override;
44 
45 private:
46     friend class UserIdmClient;
47     UserIdmClientImpl() = default;
48     ~UserIdmClientImpl() override = default;
49 
50     sptr<UserIdmInterface> GetProxy();
51 };
52 } // namespace UserAuth
53 } // namespace UserIam
54 } // namespace OHOS
55 #endif // USER_IDM_CLIENT_IMPL_H