• 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_AUTH_CLIENT_H
17 #define USER_AUTH_CLIENT_H
18 
19 #include <memory>
20 #include <vector>
21 
22 #include "user_auth_client_callback.h"
23 #include "user_auth_client_defines.h"
24 
25 namespace OHOS {
26 namespace UserIam {
27 namespace UserAuth {
28 class UserAuthClient {
29 public:
30     static UserAuthClient &GetInstance();
31     virtual ~UserAuthClient() = default;
32 
33     virtual void GetProperty(int32_t userId, const GetPropertyRequest &request,
34         const std::shared_ptr<GetPropCallback> &callback) = 0;
35     virtual void SetProperty(int32_t userId, const SetPropertyRequest &request,
36         const std::shared_ptr<SetPropCallback> &callback) = 0;
37 
38     virtual uint64_t BeginAuthentication(int32_t userId, const std::vector<uint8_t> &challenge, AuthType authType,
39         AuthTrustLevel atl, const std::shared_ptr<AuthenticationCallback> &callback) = 0;
40     virtual int32_t CancelAuthentication(uint64_t contextId) = 0;
41 
42     virtual uint64_t BeginIdentification(const std::vector<uint8_t> &challenge, AuthType authType,
43         const std::shared_ptr<IdentificationCallback> &callback) = 0;
44     virtual int32_t CancelIdentification(uint64_t contextId) = 0;
45 };
46 } // namespace UserAuth
47 } // namespace UserIam
48 } // namespace OHOS
49 #endif // USER_AUTH_CLIENT_H