Files
U2FDevice/Storage.hpp
Michael Kuc 86af080ba6 Added registration.
Currently doesn't return any valid result, hence host believes device
failed to register, however, insecure storage of keys does occur.
2018-07-31 00:09:25 +00:00

26 lines
560 B
C++

#include <map>
#include <array>
#include <string>
#include <fstream>
class Storage
{
public:
using KeyHandle = uint32_t;
using AppParam = std::array<uint8_t, 32>;
using PrivKey = std::array<uint8_t, 32>;
using PubKey = std::array<uint8_t, 65>;
protected:
Storage() = default;
static std::string filename;
public:
static void init(const std::string &dirPrefix = "");
static void save();
static std::map<KeyHandle, AppParam> appParams;
static std::map<KeyHandle, PrivKey> privKeys;
static std::map<KeyHandle, PubKey> pubKeys;
};