17 #ifndef SERVERINFO_HPP_
18 #define SERVERINFO_HPP_
22 #include <boost/cstdint.hpp>
24 #include <botan/botan.h>
25 #include <botan/base64.h>
34 ServerInfo(
const std::string& host,
const Botan::MemoryVector<boost::uint8_t>& publicKey)
35 : host_(host), publicKey_(publicKey) { }
36 ServerInfo(
const std::string& host,
const std::string& publicKey)
37 : host_(host), publicKey_(Botan::base64_decode(publicKey)) { }
40 bool isValid()
const {
return !host_.empty(); }
42 const std::string&
getHost()
const {
return host_; }
43 const Botan::MemoryVector<boost::uint8_t>&
getPublicKey()
const {
return publicKey_; }
49 Botan::MemoryVector<boost::uint8_t> publicKey_;
ServerInfo(const std::string &host, const Botan::MemoryVector< boost::uint8_t > &publicKey)
const Botan::MemoryVector< boost::uint8_t > & getPublicKey() const
ServerInfo(const std::string &host, const std::string &publicKey)
const std::string & getHost() const