38 lines
779 B
C
Raw Normal View History

2022-05-22 13:43:23 +02:00
#ifndef GCRYPT_KEY_H
#define GCRYPT_KEY_H
#include "GCrypt/Block.h"
#include <string>
namespace Leonetienne::GCrypt {
2022-06-01 02:34:16 +02:00
/** This class represents encryption keys.
* You can copy them, create them from data blocks,
* or even read from files.
2022-05-22 13:43:23 +02:00
*/
class Key : public Block {
public:
2022-05-22 17:24:56 +02:00
//! Will generate a key from a password
2022-05-22 13:43:23 +02:00
static Key FromPassword(const std::string& password);
2022-05-22 17:24:56 +02:00
//! Will generate a random key from actual randomness (std::random_device)
static Key Random();
2022-05-22 17:54:26 +02:00
//! Loads a keyfile
static Key LoadFromFile(const std::string& path);
//! Will save a keyfile
void WriteToFile(const std::string& path) const;
2022-05-22 17:54:26 +02:00
2022-05-22 13:43:23 +02:00
Key();
Key(const Key& k);
Key(const Block& b);
private:
};
}
#endif