• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024-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 #ifndef USER_AUTH_FFI_H
17 #define USER_AUTH_FFI_H
18 
19 #include "user_auth_ffi_struct.h"
20 
21 #include "user_auth_common_defines.h"
22 
23 using OHOS::UserIam::UserAuth::CjAuthParam;
24 using OHOS::UserIam::UserAuth::CjUserAuthCallback;
25 using OHOS::UserIam::UserAuth::CjUserAuthResult;
26 using OHOS::UserIam::UserAuth::CjWidgetParam;
27 using OHOS::UserIam::UserAuth::EnrolledState;
28 
29 #define FFI_EXPORT __attribute__((visibility("default")))
30 
31 extern "C" {
32 FFI_EXPORT int32_t FfiUserAuthGetAvailableStatus(uint32_t authType, uint32_t authTrustLevel);
33 
34 FFI_EXPORT int32_t FfiUserAuthGetEnrolledState(uint32_t authType, EnrolledState *enrolledState);
35 
36 FFI_EXPORT CjUserAuthCallback *FfiUserAuthNewCb(void (*callback)(CjUserAuthResult));
37 
38 FFI_EXPORT void FfiUserAuthDeleteCb(const CjUserAuthCallback *callbackPtr);
39 
40 FFI_EXPORT uint64_t FfiUserAuthStart(const CjAuthParam &authParam, const CjWidgetParam &widgetParam,
41     CjUserAuthCallback *callbackPtr);
42 
43 FFI_EXPORT int32_t FfiUserAuthCancel(uint64_t contextId);
44 }
45 
46 
47 #endif // USER_AUTH_FFI_H
48