42#ifndef _DWMCREDENCEAUTHENTICATOR_HH_
43#define _DWMCREDENCEAUTHENTICATOR_HH_
46#include <boost/asio.hpp>
48#include "DwmStreamIOCapable.hh"
85 const std::string & agreedKey,
86 std::string & theirId);
98 bool Authenticate(boost::asio::local::stream_protocol::iostream & s,
99 const std::string & agreedKey,
100 std::string & theirId);
105 std::chrono::milliseconds _timeout;
106 boost::asio::ip::tcp::endpoint _endPoint;
107 boost::asio::local::stream_protocol::endpoint _lendPoint;
108 std::unique_ptr<XChaCha20Poly1305::Ostream> _xos;
109 std::unique_ptr<XChaCha20Poly1305::Istream> _xis;
111 bool ExchangeIds(boost::asio::ip::tcp::iostream & s,
114 std::string & theirPubKey);
115 bool ExchangeIds(boost::asio::local::stream_protocol::iostream & s,
117 std::string & theirPubKey);
118 bool ExchangeChallenges(
const std::string & ourSecretKey,
119 const std::string & theirId,
120 const std::string & theirPubKey);
121 bool Send(
const std::string & msg);
123 bool Receive(std::string & msg);
125 std::string EndPointString()
const;
Dwm::Credence::KeyStash class declaration.
Dwm::Credence::KnownKeys class declaration.
Dwm::Credence::XChaCha20Poly1305::Istream class declaration.
Dwm::Credence::XChaCha20Poly1305::Ostream class declaration.
Used by Dwm::Credence::Peer for authentication.
Definition DwmCredenceAuthenticator.hh:62
void SetIdExchangeTimeout(std::chrono::milliseconds ms)
Sets the timeout for ID exchange to occur, in milliseconds.
bool Authenticate(boost::asio::local::stream_protocol::iostream &s, const std::string &agreedKey, std::string &theirId)
Authenticate the peer connected to s using the previously negotiated encryption key agreedKey to encr...
bool Authenticate(boost::asio::ip::tcp::iostream &s, const std::string &agreedKey, std::string &theirId)
Authenticate the peer connected to s using the previously negotiated encryption key agreedKey to encr...
Authenticator(const KeyStash &keyStash, const KnownKeys &knownKeys)
Construct from the given keyStash and knownKeys.
Encapsulates an Ed25519 key pair.
Definition DwmCredenceEd25519KeyPair.hh:64
Encapsulates storage of an Ed25519KeyPair in a filesystem.
Definition DwmCredenceKeyStash.hh:56
Encapsulates the storage of a set of known public keys.
Definition DwmCredenceKnownKeys.hh:60
Encapsulates a string that is restricted to 255 bytes or less.
Definition DwmCredenceShortString.hh:57