libDwmCredence-0.1.32
Dwm::Credence::Authenticator Class Reference

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.
 

Detailed Description

Used by Dwm::Credence::Peer for authentication.

Member Function Documentation

◆ Authenticate() [1/2]

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.

◆ Authenticate() [2/2]

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.


The documentation for this class was generated from the following file: