1/* 2 * Copyright (c) 2023 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/** 17 * @addtogroup HdfUserAuth 18 * @{ 19 * 20 * @brief Provides APIs for the user_auth driver. 21 * 22 * The user_auth driver provides a unified interface for the user_auth service to access the user_auth driver. 23 * After obtaining the user_auth driver proxy, the service can call related APIs to register executors, 24 * manage credentials, and complete password and biometric authentication. 25 * @since 4.0 26 */ 27 28/** 29 * @file IUserAuthInterface.idl 30 * 31 * @brief Declares the user_auth driver APIs, which can be used to register executors, 32 * manage credentials, and complete password and biometric authentication. 33 * 34 * @since 4.0 35 */ 36 37package ohos.hdi.user_auth.v1_1; 38 39import ohos.hdi.user_auth.v1_0.UserAuthTypes; 40import ohos.hdi.user_auth.v1_0.IUserAuthInterface; 41import ohos.hdi.user_auth.v1_1.UserAuthTypes; 42 43/** 44 * @brief Declares the APIs of the user_auth driver. 45 * 46 * @since 4.0 47 * @version 1.1 48 */ 49interface IUserAuthInterface extends ohos.hdi.user_auth.v1_0.IUserAuthInterface { 50 /** 51 * @brief Begins the enrollment of authentication credentials. 52 * If the authentication type is PIN, this method updates the existing PIN credential. 53 * 54 * @param userId Indicates the user ID. 55 * @param authToken Indicates the authentication token of the user password. 56 * @param param Indicates input parameters. See {@link EnrollParam}. 57 * @param info Indicates scheduling information. See {@link ScheduleInfoV1_1}. 58 * 59 * @return Returns <b>0</b> if the operation is successful. 60 * @return Returns a non-zero value if the operation fails. 61 */ 62 BeginEnrollmentV1_1([in] int userId, [in] unsigned char[] authToken, [in] struct EnrollParam param, 63 [out] struct ScheduleInfoV1_1 info); 64 /** 65 * @brief Begins authentication, and generates the authentication solution. 66 * 67 * @param contextId Indicates the context index. 68 * @param param Indicates input parameters. See {@link AuthSolution}. 69 * @param scheduleInfos Indicates scheduling information. See {@link ScheduleInfoV1_1}. 70 * 71 * @return Returns <b>0</b> if the operation is successful. 72 * @return Returns a non-zero value if the operation fails. 73 */ 74 BeginAuthenticationV1_1([in] unsigned long contextId, [in] struct AuthSolution param, 75 [out] struct ScheduleInfoV1_1[] scheduleInfos); 76 /** 77 * @brief Begins identification, and generates the identification solution. 78 * 79 * @param contextId Indicates the context index. 80 * @param authType Indicates the identification type. See @{AuthType}. 81 * @param challenge Indicates the identification challenge. 82 * @param executorSensorHint Indicates the executor sensor hint. 83 * The value <b>0</b> indicates that no value is specified. 84 * @param scheduleInfo Indicates scheduling information. See {@link ScheduleInfoV1_1}. 85 * 86 * @return Returns <b>0</b> if the operation is successful. 87 * @return Returns a non-zero value if the operation fails. 88 */ 89 BeginIdentificationV1_1([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge, 90 [in] unsigned int executorSensorHint, [out] struct ScheduleInfoV1_1 scheduleInfo); 91 /** 92 * @brief Get all enrolled user information. 93 * 94 * @param userInfos List of all userInfo. See @{UserInfo}. 95 * 96 * @return Returns <b>0</b> if the operation is successful. 97 * @return Returns a non-zero value if the operation fails. 98 */ 99 GetAllUserInfo([out] UserInfo[] userInfos); 100} 101/** @} */ 102