restructure of verify module for better code organizations

This commit is contained in:
Chris Punches
2025-03-30 22:56:13 -04:00
parent 25f9afd1c8
commit 045294aeb6
8 changed files with 204 additions and 123 deletions

View File

@@ -0,0 +1,57 @@
/**
* @file verification.hpp
* @brief Functions for verifying package integrity and signatures
*
* Defines functions for verifying checksums and signatures of DPM packages
* and package stage directories.
*
* @copyright Copyright (c) 2025 SILO GROUP LLC
* @author Chris Punches <chris.punches@silogroup.org>
*
* Part of the Dark Horse Linux Package Manager (DPM)
*/
#pragma once
#include <string>
#include <filesystem>
#include <dpmdk/include/CommonModuleAPI.hpp>
/**
* @brief Verifies checksums for a package file
*
* Checks the integrity of a package file by verifying its checksums.
*
* @param package_path Path to the package file
* @return 0 on success, non-zero on failure
*/
int verify_checksums_package(const std::string& package_path);
/**
* @brief Verifies checksums for a package stage directory
*
* Checks the integrity of a package stage directory by verifying its checksums.
*
* @param stage_dir Path to the stage directory
* @return 0 on success, non-zero on failure
*/
int verify_checksums_stage(const std::string& stage_dir);
/**
* @brief Verifies signatures for a package file
*
* Checks the signatures of a package file.
*
* @param package_path Path to the package file
* @return 0 on success, non-zero on failure
*/
int verify_signature_package(const std::string& package_path);
/**
* @brief Verifies signatures for a package stage directory
*
* Checks the signatures of a package stage directory.
*
* @param stage_dir Path to the stage directory
* @return 0 on success, non-zero on failure
*/
int verify_signature_stage(const std::string& stage_dir);