1 /*
2  * Copyright (c) 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 /**
17  * @addtogroup HdfPinAuth
18  * @{
19  *
20  * @brief Provides APIs for the pin auth driver.
21  *
22  * The pin auth driver provides a unified interface for the pin auth service to access the pin auth driver.
23  * After obtaining the pin auth driver proxy, the service can call related APIs to obtain executors.
24  * After obtaining the pin auth executors, the service can call related APIs to get executor information, get
25  * template information, and enroll, authenticate, and delete templates, etc.
26  *
27  * @since 5.0
28  * @version 1.0
29  */
30 
31 /**
32  * @file IVerifier.idl
33  *
34  * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information,
35  * cancel, authenticate, and send message, etc.
36  *
37  * @since 5.0
38  * @version 1.0
39  */
40 
41 package ohos.hdi.pin_auth.v2_0;
42 
43 import ohos.hdi.pin_auth.v2_0.PinAuthTypes;
44 import ohos.hdi.pin_auth.v2_0.IExecutorCallback;
45 
46 /**
47  * @brief Defines the APIs of the verifiers. These APIs can be used to get executor information,
48  * cancel, authenticate, and send message, etc.
49  *
50  * @since 5.0
51  * @version 1.0
52  */
53 
54 interface IVerifier {
55     /**
56      * @brief Gets executor information.
57      *
58      * @param executorInfo Indicates executor information. See {@link ExecutorInfo}.
59      *
60      * @return Returns <b>0</b> if the operation is successful.
61      * @return Returns a non-zero value if the operation fails.
62      *
63      * @since 5.0
64      * @version 1.0
65      */
66     GetExecutorInfo([out] struct ExecutorInfo executorInfo);
67     /**
68      * @brief Sends parameters to the driver when executor registration is finished.
69      *
70      * @param templateIdList Indicates the templates previously registered to the user auth framework.
71      * @param frameworkPublicKey Indicates the framework public key.
72      * @param extraInfo Indicates the extra information that is sent to the executors.
73      *
74      * @return Returns <b>0</b> if the operation is successful.
75      * @return Returns a non-zero value if the operation fails.
76      *
77      * @since 5.0
78      * @version 1.0
79      */
80     OnRegisterFinish([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey,
81         [in] unsigned char[] extraInfo);
82     /**
83      * @brief Cancels an operation.
84      *
85      * @param scheduleId Indicates the schedule ID of the operation to cancel.
86      *
87      * @return Returns <b>0</b> if the operation is successful.
88      * @return Returns a non-zero value if the operation fails.
89      *
90      * @since 5.0
91      * @version 1.0
92      */
93     Cancel([in] unsigned long scheduleId);
94     /**
95      * @brief Send message.
96      *
97      * @param scheduleId Indicates the schedule ID of the message.
98      * @param srcRole is the role of source.
99      * @param msg is the message content.
100      *
101      * @return Returns <b>0</b> if the operation is successful.
102      * @return Returns a non-zero value if the operation fails.
103      *
104      * @since 5.0
105      * @version 1.0
106      */
107     SendMessage([in] unsigned long scheduleId, [in] int srcRole, [in] unsigned char[] msg);
108     /**
109      * @brief Authenticates templates.
110      *
111      * @param scheduleId Indicates the schedule ID of authentication.
112      * @param templateIdList Indicates the templates to authenticate.
113      * @param extraInfo Indicates the extra information of authentication.
114      * @param callbackObj Indicates the callback object of authentication. See {@link IExecutorCallback}.
115      *
116      * @return Returns <b>0</b> if the operation is successful.
117      * @return Returns a non-zero value if the operation fails.
118      *
119      * @since 5.0
120      * @version 1.0
121      */
122     Authenticate([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo,
123         [in] IExecutorCallback callbackObj);
124     /**
125      * @brief Notify collector ready.
126      *
127      * @param scheduleId Indicates the schedule ID of the message.
128      *
129      * @return Returns <b>0</b> if the operation is successful.
130      * @return Returns a non-zero value if the operation fails.
131      *
132      * @since 5.0
133      * @version 1.0
134      */
135     NotifyCollectorReady([in] unsigned long scheduleId);
136 }
137 /** @} */