25 #include <openssl/sha.h>
37 : manager(m), _protocol_id(protocol_id)
62 unsigned char hash[SHA256_DIGEST_LENGTH];
63 SHA256((
const unsigned char*) data.c_str(), data.size(), hash);
65 for(
int i = 0; i < SHA256_DIGEST_LENGTH; i++)
67 stream << std::hex << std::setw(2) << std::setfill(
'0') << (int)hash[i];
73 std::stringstream stream;
75 for (string::size_type i = 0; i < data.size(); ++i)
77 unsigned char c = data[i];
78 stream << std::hex << std::setw(2) << std::setfill(
'0') << (int)c;
virtual ~KeyExchangeProtocol()
KeyExchangeProtocol(KeyExchangeManager &manager, int protocol_id)
static std::string toHex(const std::string &data)
virtual ~KeyExchangeManager()=0
void add(std::map< int, KeyExchangeProtocol * > &list)
static void sha256(std::ostream &stream, const std::string &data)
virtual KeyExchangeSession * createSession(const dtn::data::EID &peer, unsigned int uniqueId)