• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 #ifndef USER_IAM_USERIDM_INTERFACE
17 #define USER_IAM_USERIDM_INTERFACE
18 
19 #include "vector"
20 #include "stdint.h"
21 
22 namespace OHOS {
23 namespace UserIAM {
24 namespace UserIDM {
25 namespace Hal {
26 typedef struct {
27     uint64_t credentialId;
28     uint32_t authType;
29     uint64_t authSubType;
30     uint64_t templateId;
31     uint32_t capabilityLevel;
32 } CredentialInfo;
33 
34 typedef struct {
35     uint32_t authType;
36     uint64_t enrolledId;
37 } EnrolledInfo;
38 
39 int32_t OpenSession(int32_t userId, uint64_t &challenge);
40 int32_t CloseSession();
41 int32_t InitSchedulation(std::vector<uint8_t> authToken, int32_t userId, uint32_t authType, uint64_t authSubType,
42     uint64_t &scheduleId);
43 int32_t AddCredential(std::vector<uint8_t> enrollToken, uint64_t &credentialId);
44 int32_t DeleteCredential(int32_t userId, uint64_t credentialId, std::vector<uint8_t> authToken,
45     CredentialInfo &credentialInfo);
46 int32_t QueryCredential(int32_t userId, uint32_t authType, std::vector<CredentialInfo> &credentialInfos);
47 int32_t GetSecureUid(int32_t userId, uint64_t &secureUid, std::vector<EnrolledInfo> &enrolledInfos);
48 int32_t DeleteUser(int32_t userId, std::vector<uint8_t> authToken, std::vector<CredentialInfo> &credentialInfos);
49 int32_t DeleteUserEnforce(int32_t userId, std::vector<CredentialInfo> &credentialInfos);
50 int32_t UpdateCredential(std::vector<uint8_t> enrollToken, uint64_t &credentialId, CredentialInfo &deletedCredential);
51 } // Hal
52 } // UserIDM
53 } // UserIAM
54 } // OHOS
55 
56 #endif // USER_IAM_USERIDM_INTERFACE