1 /* 2 * Copyright (c) 2022-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 #ifndef OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_SERVICE_H 17 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_SERVICE_H 18 19 #include <vector> 20 #include "account_iam_mgr_stub.h" 21 #include "account_error_no.h" 22 23 namespace OHOS { 24 namespace AccountSA { 25 class AccountIAMService : public AccountIAMMgrStub { 26 public: 27 AccountIAMService(); 28 ~AccountIAMService() override; 29 30 int32_t OpenSession(int32_t userId, std::vector<uint8_t> &challenge) override; 31 int32_t CloseSession(int32_t userId) override; 32 void AddCredential( 33 int32_t userId, const CredentialParameters &credInfo, const sptr<IIDMCallback> &callback) override; 34 void UpdateCredential( 35 int32_t userId, const CredentialParameters &credInfo, const sptr<IIDMCallback> &callback) override; 36 int32_t Cancel(int32_t userId) override; 37 void DelCred(int32_t userId, uint64_t credentialId, const std::vector<uint8_t> &authToken, 38 const sptr<IIDMCallback> &callback) override; 39 void DelUser(int32_t userId, const std::vector<uint8_t> &authToken, const sptr<IIDMCallback> &callback) override; 40 int32_t GetCredentialInfo( 41 int32_t userId, AuthType authType, const sptr<IGetCredInfoCallback> &callback) override; 42 int32_t PrepareRemoteAuth( 43 const std::string &remoteNetworkId, const sptr<IPreRemoteAuthCallback> &callback) override; 44 int32_t AuthUser(AuthParam &authParam, const sptr<IIDMCallback> &callback, uint64_t &contextId) override; 45 int32_t CancelAuth(uint64_t contextId) override; 46 int32_t GetAvailableStatus(AuthType authType, AuthTrustLevel authTrustLevel, int32_t &status) override; 47 void GetProperty( 48 int32_t userId, const GetPropertyRequest &request, const sptr<IGetSetPropCallback> &callback) override; 49 void GetPropertyByCredentialId(uint64_t credentialId, std::vector<Attributes::AttributeKey> &keys, 50 const sptr<IGetSetPropCallback> &callback) override; 51 void SetProperty( 52 int32_t userId, const SetPropertyRequest &request, const sptr<IGetSetPropCallback> &callback) override; 53 void GetEnrolledId(int32_t accountId, AuthType authType, const sptr<IGetEnrolledIdCallback> &callback) override; 54 IAMState GetAccountState(int32_t userId) override; 55 56 private: 57 DISALLOW_COPY_AND_MOVE(AccountIAMService); 58 }; 59 } // namespace AccountSA 60 } // namespace OHOS 61 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_ACCOUNT_IAM_SERVICE_H 62