1 /*
2  * Copyright (c) 2024-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 #include "sign_block_info.h"
17 
18 namespace OHOS {
19 namespace SignatureTools {
20 
SignBlockInfo()21 SignBlockInfo::SignBlockInfo()
22 {
23 }
24 
SignBlockInfo(bool needGenerateDigest)25 SignBlockInfo::SignBlockInfo(bool needGenerateDigest)
26 {
27     m_needGenerateDigest = needGenerateDigest;
28 }
29 
GetSignBlockMap()30 std::unordered_map<int8_t, SigningBlock>& SignBlockInfo::GetSignBlockMap()
31 {
32     return m_signBlockMap;
33 }
34 
GetFileDigest()35 std::vector<int8_t>& SignBlockInfo::GetFileDigest()
36 {
37     return m_fileDigest;
38 }
39 
SetFileDigest(const std::vector<int8_t>& fileDigest)40 void SignBlockInfo::SetFileDigest(const std::vector<int8_t>& fileDigest)
41 {
42     m_fileDigest = fileDigest;
43 }
44 
GetRawDigest()45 std::vector<int8_t>& SignBlockInfo::GetRawDigest()
46 {
47     return m_rawDigest;
48 }
49 
SetRawDigest(const std::vector<int8_t>& rawDigest)50 void SignBlockInfo::SetRawDigest(const std::vector<int8_t>& rawDigest)
51 {
52     m_rawDigest = rawDigest;
53 }
54 
GetNeedGenerateDigest()55 bool SignBlockInfo::GetNeedGenerateDigest()
56 {
57     return m_needGenerateDigest;
58 }
59 
60 } // namespace SignatureTools
61 } // namespace OHOS