42 #ifndef _DWMAUTHPEERAUTHENTICATOR_HH_ 43 #define _DWMAUTHPEERAUTHENTICATOR_HH_ 48 #include <boost/asio.hpp> 88 const std::string & pubKeysPath);
97 const std::string & pubKeysPath);
107 std::string & agreedKey);
113 std::string & theirId,
114 std::string & agreedKey);
119 std::string _pubKeysPath;
122 bool ECExchange(boost::asio::ip::tcp::socket & s,
124 std::string BuildIDAndSignature(
const ECDHAgreement & agreement);
125 bool IDAndSigExchange(
int fd,
const ECDHAgreement & agreement,
126 std::string & theirId,
127 std::string & theirIdCrypted,
128 std::string & theirSig);
129 bool IDAndSigExchange(boost::asio::ip::tcp::socket & s,
131 std::string & theirId,
132 std::string & theirIdCrypted,
133 std::string & theirSig);
134 int BytesReady(
int fd)
const;
135 bool WaitForBytesReady(
int fd, uint32_t numBytes,
136 std::chrono::milliseconds timeout)
const;
143 #endif // _DWMAUTHPEERAUTHENTICATOR_HH_ bool Authenticate(int fd, std::string &theirId, std::string &agreedKey)
Authenticate the peer connected to the socket fd.
Encapsulates a private/public key pair.
Definition: DwmAuthEd25519Keys.hh:147
A simplified peer authenticator.
Definition: DwmAuthPeerAuthenticator.hh:71
Dwm::Auth::ECDHAgreement class definition.
Encapsulates information used in an ECDH key agreement.
Definition: DwmAuthECDHAgreement.hh:57
PeerAuthenticator(const std::string &myPrivKeyPath, const std::string &pubKeysPath)
Construct from a path to our ed25519 private key and a path to a file containing public keys.
Dwm::Auth::PublicKeysFile class definition.