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 #include "secure_user_info_impl.h"
17 #include "enrolled_info_impl.h"
18
19 #include "hdi_wrapper.h"
20 #include "iam_logger.h"
21
22 #define LOG_LABEL UserIam::Common::LABEL_USER_AUTH_SA
23 namespace OHOS {
24 namespace UserIam {
25 namespace UserAuth {
SecureUserInfoImpl(int32_t userId,PinSubType pinSubType,uint64_t secUserId,std::vector<std::shared_ptr<EnrolledInfo>> info)26 SecureUserInfoImpl::SecureUserInfoImpl(int32_t userId, PinSubType pinSubType, uint64_t secUserId,
27 std::vector<std::shared_ptr<EnrolledInfo>> info)
28 : userId_(userId),
29 pinSubType_(pinSubType),
30 secUserId_(secUserId),
31 info_(std::move(info))
32 {
33 }
34
35 SecureUserInfoImpl::~SecureUserInfoImpl() = default;
36
GetUserId() const37 int32_t SecureUserInfoImpl::GetUserId() const
38 {
39 return userId_;
40 }
41
GetPinSubType() const42 PinSubType SecureUserInfoImpl::GetPinSubType() const
43 {
44 return pinSubType_;
45 }
46
GetSecUserId() const47 uint64_t SecureUserInfoImpl::GetSecUserId() const
48 {
49 return secUserId_;
50 }
51
GetEnrolledInfo() const52 std::vector<std::shared_ptr<EnrolledInfo>> SecureUserInfoImpl::GetEnrolledInfo() const
53 {
54 return info_;
55 }
56 } // namespace UserAuth
57 } // namespace UserIam
58 } // namespace OHOS