1/* 2 * Copyright (c) 2025 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 16import UserAuthTypes; 17import IGetExecutorPropertyCallback; 18import ISetExecutorPropertyCallback; 19import IIamCallback; 20import IWidgetCallback; 21import IVerifyTokenCallback; 22import IModalCallback; 23import IEventListenerCallback; 24 25option_stub_hooks on; 26 27interface OHOS.UserIam.UserAuth.IUserAuth { 28 int GetAvailableStatus([in] int apiVersion, [in] int userId, [in] int authType, 29 [in] unsigned int authTrustLevel); 30 31 int GetAvailableStatus([in] int apiVersion, [in] int authType, [in] unsigned int authTrustLevel); 32 33 void GetProperty([in] int userId, [in] int authType, 34 [in] unsigned int[] keys, [in] IGetExecutorPropertyCallback getExecutorPropertyCallback); 35 36 void GetPropertyById([in] unsigned long credentialId, [in] unsigned int[] keys, 37 [in] IGetExecutorPropertyCallback getExecutorPropertyCallback); 38 39 void SetProperty([in] int userId, [in] int authType, [in] unsigned char[] attributes, 40 [in] ISetExecutorPropertyCallback setExecutorPropertyCallback); 41 42 void AuthUser([in] IpcAuthParamInner ipcAuthParamInner, [in] IpcRemoteAuthParam ipcRemoteAuthParam, 43 [in] IIamCallback userAuthCallback, [out] unsigned long contextId); 44 45 void Auth([in] int apiVersion, [in] IpcAuthParamInner ipcAuthParamInner, 46 [in] IIamCallback userAuthCallback, [out] unsigned long contextId); 47 48 void AuthWidget([in] int apiVersion, [in] IpcAuthParamInner ipcAuthParamInner, 49 [in] IpcWidgetParamInner ipcWidgetParamInner, [in] IIamCallback userAuthCallback, 50 [in] IModalCallback modalCallback, [out] unsigned long contextId); 51 52 void Identify([in] unsigned char[] challenge, [in] int authType, 53 [in] IIamCallback userAuthCallback, [out] unsigned long contextId); 54 55 void CancelAuthOrIdentify([in] unsigned long contextId, [in] int cancelReason); 56 57 void GetVersion([out] int version); 58 59 void Notice([in] int noticeType, [in] String eventData); 60 61 void RegisterWidgetCallback([in] int version, [in] IWidgetCallback widgetCallback); 62 63 int GetEnrolledState([in] int apiVersion, [in] int authType, [out] IpcEnrolledState ipcEnrolledState); 64 65 void RegistUserAuthSuccessEventListener([in] IEventListenerCallback listener); 66 67 void UnRegistUserAuthSuccessEventListener([in] IEventListenerCallback listener); 68 69 void SetGlobalConfigParam([in] IpcGlobalConfigParam ipcGlobalConfigParam); 70 71 void PrepareRemoteAuth([in] String networkId, [in] IIamCallback userAuthCallback); 72 73 void VerifyAuthToken([in] unsigned char[] tokenIn, [in] unsigned long allowableDuration, 74 [in] IVerifyTokenCallback verifyTokenCallback); 75 76 void QueryReusableAuthResult([in] IpcAuthParamInner ipcAuthParamInner, [out] unsigned char[] token); 77}