diff --git a/pinauth/v1_0/BUILD.gn b/pinauth/v1_0/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a4a8b07f9f2077422c50688774bc5affce236545 --- /dev/null +++ b/pinauth/v1_0/BUILD.gn @@ -0,0 +1,27 @@ +# 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. + +import("//drivers/adapter/uhdf2/hdi.gni") # 编译idl必须要导入的模板 +hdi("pinauth") { # 目标名称,会生成两个so: libfoo_[proxy/stub]_1.0.z.so + module_name = "pinauth" # module_name匹配dirver文件中驱动描述符(HdfDriverEntry)的moduleName + sources = [ # 参与编译的idl文件 + "IExecutor.idl", + "IExecutorCallback.idl", + "Types.idl", + "IPinAuthInterface.idl", + "IInputterCallback.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/pinauth/v1_0/IExecutor.idl b/pinauth/v1_0/IExecutor.idl new file mode 100644 index 0000000000000000000000000000000000000000..8e9a61bd625e066d2a389ea18456ab71e6becd6d --- /dev/null +++ b/pinauth/v1_0/IExecutor.idl @@ -0,0 +1,30 @@ +/* + * 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.pinauth.v1_0; + +import ohos.hdi.pinauth.v1_0.Types; +import ohos.hdi.pinauth.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); + Delete([in] unsigned long [] templateIdList); + Cancel([in] int scheduleId); + SendCommand([in] enum CommandId commandId, [in] byte [] extraInfo, [in] IExecutorCallback callbackObj); +} diff --git a/pinauth/v1_0/IExecutorCallback.idl b/pinauth/v1_0/IExecutorCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..385439894884eb685dab10e896f1a8451757dc43 --- /dev/null +++ b/pinauth/v1_0/IExecutorCallback.idl @@ -0,0 +1,23 @@ +/* + * 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.pinauth.v1_0; + +import ohos.hdi.pinauth.v1_0.IInputterCallback; + +[callback] interface IExecutorCallback { + OnResult([in] int code, [in] byte[] extraInfo); + OnGetData([in] byte[] salt, [in] int authSubType, [in] IInputterCallback callbackObj); +} \ No newline at end of file diff --git a/pinauth/v1_0/IInputterCallback.idl b/pinauth/v1_0/IInputterCallback.idl new file mode 100644 index 0000000000000000000000000000000000000000..44f11d048523d9b2bff24c5dd3e8904e1f8bfcb8 --- /dev/null +++ b/pinauth/v1_0/IInputterCallback.idl @@ -0,0 +1,20 @@ +/* + * 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.pinauth.v1_0; + +[callback] interface IInputterCallback { + OnSetData([in] int authSubType, [in] byte[] data); +} \ No newline at end of file diff --git a/pinauth/v1_0/IPinAuthInterface.idl b/pinauth/v1_0/IPinAuthInterface.idl new file mode 100644 index 0000000000000000000000000000000000000000..d59a1957694577c922ef6037eca18f589ff47927 --- /dev/null +++ b/pinauth/v1_0/IPinAuthInterface.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.pinauth.v1_0; + +import ohos.hdi.pinauth.v1_0.IExecutor; + +interface IPinAuthInterface { + GetExecutorList([out] IExecutor [] executorList); +} \ No newline at end of file diff --git a/pinauth/v1_0/Types.idl b/pinauth/v1_0/Types.idl new file mode 100644 index 0000000000000000000000000000000000000000..5f30bcb4bc21706bdbb755b8a8fda6ff738d7de7 --- /dev/null +++ b/pinauth/v1_0/Types.idl @@ -0,0 +1,59 @@ +/* + * 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.pinauth.v1_0; + +enum AuthType : unsigned int { + PIN, + FACE, + FINGERPRINT +}; + +enum ExecutorRole : unsigned int { + COLLECTOR, + VERIFIER, + ALL_IN_ONE +}; + +enum ExecutorSecureLevel : unsigned int { + ESL0, + ESL1, + ESL2, + ESL3 +}; + +enum CommandId : unsigned int { + ENROLL = 0, + AUTH, + DELETE, + QUERY = 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