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 USERIDM_SET_PROP_HANDLER_H 17 #define USERIDM_SET_PROP_HANDLER_H 18 19 #include "iuseridm_callback.h" 20 #include "useridm_module.h" 21 #include "set_prop_callback.h" 22 23 namespace OHOS { 24 namespace UserIAM { 25 namespace UserIDM { 26 class UserIDMSetPropHandler : public CoAuth::SetPropCallback { 27 public: 28 UserIDMSetPropHandler(AuthType type, const uint64_t challenge, const uint64_t sessionId, uint64_t credentialId, 29 const std::shared_ptr<UserIDMModule>& data, const sptr<IIDMCallback>& callback); 30 virtual ~UserIDMSetPropHandler() = default; 31 32 void OnResult(uint32_t result, std::vector<uint8_t>& extraInfo) override; 33 void ResetCallback(); 34 35 private: 36 uint64_t lastChallenge_; 37 uint64_t lastScheduleId_; 38 uint64_t lastCredentialId_; 39 std::shared_ptr<UserIDMModule> propDataCallback_; 40 sptr<IIDMCallback> propInnerCallback_; 41 AuthType type_; // 0: add cred 1: modify cred 42 std::mutex mutex_; 43 }; 44 } // namespace UserIDM 45 } // namespace UserIAM 46 } // namespace OHOS 47 #endif // USERIDM_SET_PROP_HANDLER_PROXY_H 48