/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @addtogroup HdfUserAuth
 * @{
 *
 * @brief Provides APIs for the user_auth driver.
 *
 * The user_auth driver provides a unified interface for the user_auth service to access the user_auth driver.
 * After obtaining the user_auth driver proxy, the service can call related APIs to register executors, 
 * manage credentials, and complete password and biometric authentication.
 * @since 4.0
 */

/**
 * @file IUserAuthInterface.idl
 *
 * @brief Declares the user_auth driver APIs, which can be used to register executors, 
 * manage credentials, and complete password and biometric authentication.
 *
 * @since 4.0
 */

package ohos.hdi.user_auth.v1_1;

import ohos.hdi.user_auth.v1_0.UserAuthTypes;
import ohos.hdi.user_auth.v1_0.IUserAuthInterface;
import ohos.hdi.user_auth.v1_1.UserAuthTypes;

/**
 * @brief Declares the APIs of the user_auth driver.
 *
 * @since 4.0
 * @version 1.1
 */
interface IUserAuthInterface extends ohos.hdi.user_auth.v1_0.IUserAuthInterface {
    /**
     * @brief Begins the enrollment of authentication credentials. 
     * If the authentication type is PIN, this method updates the existing PIN credential.
     *
     * @param userId Indicates the user ID.
     * @param authToken Indicates the authentication token of the user password.
     * @param param Indicates input parameters. See {@link EnrollParam}.
     * @param info Indicates scheduling information. See {@link ScheduleInfoV1_1}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     */
    BeginEnrollmentV1_1([in] int userId, [in] unsigned char[] authToken, [in] struct EnrollParam param, 
        [out] struct ScheduleInfoV1_1 info);
    /**
     * @brief Begins authentication, and generates the authentication solution.
     *
     * @param contextId Indicates the context index.
     * @param param Indicates input parameters. See {@link AuthSolution}.
     * @param scheduleInfos Indicates scheduling information. See {@link ScheduleInfoV1_1}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     */
    BeginAuthenticationV1_1([in] unsigned long contextId, [in] struct AuthSolution param,
        [out] struct ScheduleInfoV1_1[] scheduleInfos);
    /**
     * @brief Begins identification, and generates the identification solution.
     *
     * @param contextId Indicates the context index.
     * @param authType Indicates the identification type. See @{AuthType}.
     * @param challenge Indicates the identification challenge.
     * @param executorSensorHint Indicates the executor sensor hint.
     * The value <b>0</b> indicates that no value is specified.
     * @param scheduleInfo Indicates scheduling information. See {@link ScheduleInfoV1_1}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     */
    BeginIdentificationV1_1([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge,
        [in] unsigned int executorSensorHint, [out] struct ScheduleInfoV1_1 scheduleInfo);
    /**
     * @brief Get all enrolled user information.
     *
     * @param userInfos List of all userInfo. See @{UserInfo}.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     */
    GetAllUserInfo([out] UserInfo[] userInfos);
}
/** @} */