Lliuziweifix
e10ed864创建于 2024年3月15日历史提交
/*
 * Copyright (c) 2024 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 5.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 5.0
 */

package ohos.hdi.user_auth.v1_3;

import ohos.hdi.user_auth.v1_2.UserAuthTypes;
import ohos.hdi.user_auth.v1_2.IUserAuthInterface;
import ohos.hdi.user_auth.v1_3.UserAuthTypes;

/**
 * @brief Declares the APIs of the user_auth driver.
 *
 * @since 5.0
 * @version 1.3
 */
interface IUserAuthInterface extends ohos.hdi.user_auth.v1_2.IUserAuthInterface {

    /**
     * @brief Querying EnrolledId information.
     *
     * @param userId Indicates the user ID.
     * @param authType Indicates the identification type. See @{AuthType}.
     * @param info EnrolledId information.
     * 
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.3
     */
    GetEnrolledState([in] int userId, [in] enum AuthType authType,
        [out] struct EnrolledState info);

    /**
     * @brief Updates the authentication result, and evaluates the result of the authentication solution.
     *
     * @param contextId Indicates the context index.
     * @param scheduleResult Indicates the authentication result issued by the executor.
     * @param info Indicates authentication result information. See {@link AuthResultInfo}.
     * @param enrolledState EnrolledID information.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.3
     */
    UpdateAuthenticationResultWithEnrolledState([in] unsigned long contextId, [in] unsigned char[] scheduleResult,
        [out] struct AuthResultInfo info, [out] EnrolledState enrolledState);

    /**
     * @brief Check if unlock result can be reused and return token. 
     *
     * @param info Request information of reused unLock result. See {@link ReuseUnlockInfo}.
     * @param token Authentication token.
     *
     * @return Returns <b>0</b> if the operation is successful.
     * @return Returns a non-zero value if the operation fails.
     *
     * @since 5.0
     * @version 1.3
     */
    CheckReuseUnlockResult([in] struct ReuseUnlockInfo info, [out] unsigned char[] token);
}
/** @} */