Used by Dwm::Credence::Peer for authentication. More...
#include <DwmCredenceAuthenticator.hh>
Public Member Functions | |
| Authenticator (const KeyStash &keyStash, const KnownKeys &knownKeys) | |
Construct from the given keyStash and knownKeys. | |
| void | SetIdExchangeTimeout (std::chrono::milliseconds ms) |
| Sets the timeout for ID exchange to occur, in milliseconds. | |
| 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 encrypt and decrypt all communication. | |
| 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 encrypt and decrypt all communication. | |
Used by Dwm::Credence::Peer for authentication.
| bool Dwm::Credence::Authenticator::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 encrypt and decrypt all communication.
For success, the peer's public key must be in our KnownKeys and the peer must be able to properly sign a random challenge we transmit to them. In addition, our public key must be in the peer's KnownKeys and we must be able to properly sign a random challenge received from the peer. Returns true on success and sets theirId to the ID of the peer.
| bool Dwm::Credence::Authenticator::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 encrypt and decrypt all communication.
For success, the peer's public key must be in our KnownKeys and the peer must be able to properly sign a random challenge we transmit to them. In addition, our public key must be in the peer's KnownKeys and we must be able to properly sign a random challenge received from the peer. Returns true on success and sets theirId to the ID of the peer.