1 // Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef COMMON_STEP_SECURITY_STEP_SIGNATURE_H_
6 #define COMMON_STEP_SECURITY_STEP_SIGNATURE_H_
8 #include <manifest_parser/utils/logging.h>
13 #include "common/installer_context.h"
14 #include "common/step/step.h"
15 #include "common/signature.h"
17 namespace common_installer {
21 * \brief Step responsible for checking signature of given package and
22 * saving certificates into individual files to restore certificate database.
23 * Used by WGT and TPK backend
25 class StepSignature : public Step {
29 StepSignature(InstallerContext* context, bool save_signature)
30 : Step(context), save_signature_(save_signature) {}
32 Status process() override;
33 Status undo() override;
34 Status clean() override;
35 Status precheck() override;
38 virtual std::filesystem::path GetSignatureRoot() const;
39 virtual Status CheckPrivilegeLevel(PrivilegeLevel level);
43 std::filesystem::path backup_path_;
44 std::unique_ptr<Signature> signature_;
49 } // namespace security
50 } // namespace common_installer
52 #endif // COMMON_STEP_SECURITY_STEP_SIGNATURE_H_