32 lines
871 B
C++
32 lines
871 B
C++
#pragma once
|
|
|
|
#include "../cryptopp/rsa.h"
|
|
#include <string>
|
|
|
|
class IntegretyCheck {
|
|
public:
|
|
IntegretyCheck();
|
|
IntegretyCheck(const std::string &appPath, const std::string &keyFile,
|
|
const std::string &hashList);
|
|
|
|
bool loadKeyFile(const std::string &app);
|
|
bool saveKeyFile(const std::string &app);
|
|
bool generateKeyPair();
|
|
|
|
std::string loadHashList(const std::string &hashList);
|
|
std::string generateHashList(const std::string &app);
|
|
std::string generateFileHash(const std::string &filepath);
|
|
|
|
void signHashList(std::string &hashList);
|
|
bool verifyHashList(const std::string &signedHashList);
|
|
|
|
static const int KEY_SIZE;
|
|
static const std::string HASH_FILE;
|
|
static const std::string KEY_FILE;
|
|
static const std::string SIGNATURE_MARKER;
|
|
|
|
private:
|
|
CryptoPP::RSA::PublicKey m_publicKey;
|
|
CryptoPP::RSA::PrivateKey m_privateKey;
|
|
};
|