20 #include <botan/botan.h>
25 #include <boost/scoped_array.hpp>
29 typedef std::pair<Botan::MemoryVector<std::uint8_t>, std::string>
KeyPair;
49 static Botan::MemoryVector<std::uint8_t>
loadPublicKey(
const std::string& fileName);
53 static KeyPair loadKeyPair(
const std::string& pubFileName,
const std::string& privFileName);
55 static void saveKeyPair(
const KeyPair& pair,
const std::string& pubFileName,
const std::string& privFileName);
57 static void savePublicKey(
const Botan::MemoryVector<std::uint8_t>& key,
const std::string& pubFileName);
59 static void savePrivateKey(
const std::string& key,
const std::string& privFileName);
62 static void readFile(
const std::string& fileName, boost::scoped_array<char>& buf, std::size_t& len);
65 Botan::AutoSeeded_RNG rng_;
std::pair< Botan::MemoryVector< std::uint8_t >, std::string > KeyPair
static void savePublicKey(const Botan::MemoryVector< std::uint8_t > &key, const std::string &pubFileName)
static KeyPair loadKeyPair(const std::string &pubFileName, const std::string &privFileName)
KeyPair generateKeyPair(std::size_t length)
static Botan::MemoryVector< std::uint8_t > loadPublicKey(const std::string &fileName)
static std::string loadPrivateKey(const std::string &fileName)
Botan::SymmetricKey generateSessionKey(std::size_t length)
static void savePrivateKey(const std::string &key, const std::string &privFileName)
static void saveKeyPair(const KeyPair &pair, const std::string &pubFileName, const std::string &privFileName)