diff --git a/faceauth/v1_0/BUILD.gn b/faceauth/v1_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5abf712b51abe3121d5e2875b5b51d5abb2bcc42 --- /dev/null +++ b/faceauth/v1_0/BUILD.gn @@ -0,0 +1,13 @@ +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("faceauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "faceauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IExecutor.idl", + "IExecutorCallback.idl", + "Types.idl", + "IFaceAuthInterface.idl", + ] + language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` + subsystem_name = "hdf" # 子系统,统一填写“hdf” + part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 +} \ No newline at end of file diff --git a/faceauth/v1_0/IExecutor.idl b/faceauth/v1_0/IExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..3c287beb1d4bf43c533e21b9ff59b67d149a4e36 --- /dev/null +++ b/faceauth/v1_0/IExecutor.idl @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +import ohos.hdi.faceauth.v1_0.Types; +import ohos.hdi.faceauth.v1_0.IExecutorCallback; + +interface IExecutor { + GetExecutorInfo([out] struct ExecutorInfo info); + GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo info); + OnRegisterFinish([in] unsigned long templateIdList, [in] byte [] frameworkPublicKey, [in] byte [] extraInfo); + Enroll([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Authenticate([in] int scheduleId, [in] unsigned long [] templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Identify([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Delete([in] unsigned long [] templateIdList); + Cancel([in] int scheduleId); + SendCommand([in] enum CommandId commandId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); +} \ No newline at end of file diff --git a/faceauth/v1_0/IExecutorCallback.idl b/faceauth/v1_0/IExecutorCallback.idl new file mode 100755 index 0000000000000000000000000000000000000000..ee004862520d260ff26f727b5cb98b094930cb68 --- /dev/null +++ b/faceauth/v1_0/IExecutorCallback.idl @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +[callback] interface IExecutorCallback { + onResult([in] int code, [in] byte[] extraInfo); + onAcquireInfo([in] int code, [in] byte[] extraInfo); +} \ No newline at end of file diff --git a/faceauth/v1_0/IFaceAuthInterface.idl b/faceauth/v1_0/IFaceAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..070f44dd7339b66e3c0e005dfdc56ff033aa0205 --- /dev/null +++ b/faceauth/v1_0/IFaceAuthInterface.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +import ohos.hdi.faceauth.v1_0.IExecutor; + +interface IFaceAuthInterface { + GetExecutorList([out] IExecutor [] executorList); +} \ No newline at end of file diff --git a/faceauth/v1_0/Types.idl b/faceauth/v1_0/Types.idl new file mode 100755 index 0000000000000000000000000000000000000000..97786a54eeaee1113a74e485aaab1fe0f17c69c8 --- /dev/null +++ b/faceauth/v1_0/Types.idl @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.faceauth.v1_0; + +enum AuthType : unsigned int { + FACE, + FINGERPRINT +}; + +enum ExecutorRole : unsigned int { + COLLECTOR, + VERIFIER, + ALL_IN_ONE +}; + +enum ExecutorSecureLevel : unsigned int { + ESL0, + ESL1, + ESL2, + ESL3 +}; + +enum CommandId : unsigned int { + LOCK_TEMPLATE = 0, + UNLOCK_TEMPLATE, + VENDOR_COMMAND_BEGIN = 10000 +}; + +struct ExecutorInfo { + unsigned int sensorId; + unsigned int executorType; + enum ExecutorRole executorRole; + enum AuthType authType; + enum ExecutorSecureLevel esl; + byte[] publicKey; + byte[] extraInfo; +}; + +struct TemplateInfo { + unsigned int executorType; + int freezingTime; + int remainTimes; + byte[] extraInfo; +}; \ No newline at end of file diff --git a/userauth/v1_0/BUILD.gn b/userauth/v1_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..96797d6d63669b4d5986e16a1af48d81885818c3 --- /dev/null +++ b/userauth/v1_0/BUILD.gn @@ -0,0 +1,13 @@ +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("userauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "userauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IExecutor.idl", + "IExecutorCallback.idl", + "Types.idl", + "IUserAuthInterface.idl", + ] + language = "cpp" # 控制idl生成c或c++代码 可选择`c`或`cpp` + subsystem_name = "hdf" # 子系统,统一填写“hdf” + part_name = "hdf_device_driver" # 部件名,如果不属于已有部件,则需要定义新的部件 +} \ No newline at end of file diff --git a/userauth/v1_0/IExecutor.idl b/userauth/v1_0/IExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..172ab63f0e7d86a033f4cf3d5735d1022257fe1e --- /dev/null +++ b/userauth/v1_0/IExecutor.idl @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +import ohos.hdi.userauth.v1_0.Types; +import ohos.hdi.userauth.v1_0.IExecutorCallback; + +interface IExecutor { + GetExecutorInfo([out] struct ExecutorInfo info); + GetTemplateInfo([in] unsigned long templateId, [out] struct TemplateInfo info); + OnRegisterFinish([in] unsigned long templateIdList, [in] byte [] frameworkPublicKey, [in] byte [] extraInfo); + Enroll([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Authenticate([in] int scheduleId, [in] unsigned long templateIdList, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Identify([in] int scheduleId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); + Delete([in] unsigned long [] templateIdList); + Cancel([in] int scheduleId); + SendCommand([in] enum CommandId commandId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); +} \ No newline at end of file diff --git a/userauth/v1_0/IExecutorCallback.idl b/userauth/v1_0/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..8cafcd4fe762801ecd43b9d295dd5497b2f63a00 --- /dev/null +++ b/userauth/v1_0/IExecutorCallback.idl @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +[callback] interface IExecutorCallback { + onResult([in] int code, [in] byte[] extraInfo); + onAcquireInfo([in] int code, [in] byte[] extraInfo); +} \ No newline at end of file diff --git a/userauth/v1_0/IUserAuthInterface.idl b/userauth/v1_0/IUserAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..67d1da1547669277625960f42e51a69df60b928c --- /dev/null +++ b/userauth/v1_0/IUserAuthInterface.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +import ohos.hdi.userauth.v1_0.IExecutor; + +interface IUserAuthInterface { + GetExecutorList([out] IExecutor [] executorList); +} \ No newline at end of file diff --git a/userauth/v1_0/Types.idl b/userauth/v1_0/Types.idl new file mode 100644 index 0000000000000000000000000000000000000000..a9714a44b32d8ad87eebd6e7aad9152069b946cd --- /dev/null +++ b/userauth/v1_0/Types.idl @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 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. + */ + +package ohos.hdi.userauth.v1_0; + +enum AuthType : unsigned int { + FACE, + FINGERPRINT +}; + +enum ExecutorRole : unsigned int { + COLLECTOR, + VERIFIER, + ALL_IN_ONE +}; + +enum ExecutorSecureLevel : unsigned int { + ESL0, + ESL1, + ESL2, + ESL3 +}; + +enum CommandId : unsigned int { + LOCK_TEMPLATE = 0, + UNLOCK_TEMPLATE, + VENDOR_COMMAND_BEGIN = 10000 +}; + +struct ExecutorInfo { + unsigned int sensorId; + unsigned int executorType; + enum ExecutorRole executorRole; + enum AuthType authType; + enum ExecutorSecureLevel esl; + byte[] publicKey; + byte[] extraInfo; +}; + +struct TemplateInfo { + unsigned int executorType; + int freezingTime; + int remainTimes; + byte[] extraInfo; +}; \ No newline at end of file