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 OS_ACCOUNT_INTERFACES_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_INFO_H 17 #define OS_ACCOUNT_INTERFACES_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_INFO_H 18 19 #include "attributes.h" 20 #include "iam_common_defines.h" 21 #ifdef HAS_PIN_AUTH_PART 22 #include "i_inputer.h" 23 #endif 24 #include "user_auth_client_callback.h" 25 #include "user_auth_client_defines.h" 26 #include "user_idm_client.h" 27 #include "user_idm_client_callback.h" 28 #include "user_idm_client_defines.h" 29 30 namespace OHOS { 31 namespace AccountSA { 32 #ifdef HAS_PIN_AUTH_PART 33 typedef UserIam::PinAuth::IInputer IInputer; 34 typedef UserIam::PinAuth::IInputerData IInputerData; 35 #endif 36 #ifdef HAS_USER_AUTH_PART 37 typedef UserIam::UserAuth::ResultCode ResultCode; 38 typedef UserIam::UserAuth::AuthType AuthType; 39 typedef UserIam::UserAuth::Attributes Attributes; 40 typedef UserIam::UserAuth::AuthTrustLevel AuthTrustLevel; 41 typedef UserIam::UserAuth::AuthenticationCallback AuthenticationCallback; 42 typedef UserIam::UserAuth::GetPropCallback GetPropCallback; 43 typedef UserIam::UserAuth::SetPropCallback SetPropCallback; 44 typedef UserIam::UserAuth::GetPropertyRequest GetPropertyRequest; 45 typedef UserIam::UserAuth::SetPropertyRequest SetPropertyRequest; 46 typedef UserIam::UserAuth::PropertyMode PropertyMode; 47 typedef UserIam::UserAuth::PinSubType PinSubType; 48 typedef UserIam::UserAuth::UserIdmClientCallback UserIdmClientCallback; 49 typedef UserIam::UserAuth::CredentialParameters CredentialParameters; 50 typedef UserIam::UserAuth::CredentialInfo CredentialInfo; 51 typedef UserIam::UserAuth::GetCredentialInfoCallback GetCredentialInfoCallback; 52 #endif 53 54 enum IAMAuthType { 55 DOMAIN = 1024 56 }; 57 58 enum IAMAuthSubType { 59 DOMAIN_MIXED = 10240001 60 }; 61 62 enum IAMState { 63 IDLE = 0, 64 AFTER_OPEN_SESSION, 65 DURING_AUTHENTICATE, 66 DURING_ADD_CRED, 67 DURING_UPDATE_CRED, 68 DURING_DEL_CRED, 69 AFTER_ADD_CRED, 70 AFTER_UPDATE_CRED, 71 AFTER_DEL_CRED, 72 ROLL_BACK_ADD_CRED, 73 ROLL_BACK_UPDATE_CRED, 74 ROLL_BACK_DEL_CRED, 75 DURING_DEL_USER, 76 }; 77 78 struct CredentialItem { 79 int32_t type = 0; 80 std::vector<uint8_t> oldCredential; 81 std::vector<uint8_t> credential; 82 }; 83 } // namespace AccountSA 84 } // namespace OHOS 85 #endif // OS_ACCOUNT_INTERFACES_INNERKITS_ACCOUNT_IAM_NATIVE_INCLUDE_ACCOUNT_IAM_INFO_H 86