A bit of cleanup

This commit is contained in:
Leonetienne
2022-05-27 16:44:42 +02:00
parent b0d0f831d9
commit 5365233b43
7 changed files with 82 additions and 60 deletions

View File

@@ -0,0 +1,26 @@
#ifndef GCRYPTCLI_KEYMANAGER_H
#define GCRYPTCLI_KEYMANAGER_H
#include <GCrypt/Key.h>
using namespace Leonetienne::GCrypt;
// This class has the task to prepare and supply the encryption key.
class KeyManager {
public:
//! Will prepare the key. Be it from cli, a file, or, random, or whatever.
static void PrepareKey();
//! Will return the key, if prepared.
static const Key& GetKey();
private:
//! Will ask for a password on stdin,
//! hiding the input.
static std::string PasswordPrompt();
static Key key;
};
#endif