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

Encapsulates a challenge response. More...

#include <DwmCredenceChallengeResponse.hh>

Public Member Functions

 ChallengeResponse ()=default
 Default constructor.
 
 ChallengeResponse (const ChallengeResponse &)=default
 Default copy constructor.
 
bool Create (const std::string &signingKey, const Challenge &challenge)
 Given a challenge, creates the response using the given signingKey.
 
std::istream & Read (std::istream &is)
 Reads the challenge response from the given istream is.
 
std::ostream & Write (std::ostream &os) const
 Writes the challenge response to the given ostream os.
 
bool Verify (const std::string &publicKey, const std::string &challengeString) const
 Using the given publicKey of the source of the response, verifies that the response was signed by the source and that the response contents matches the given challengeString.
 

Detailed Description

Encapsulates a challenge response.

This is used when responding to a Challenge during authentication to a client or server.

Member Function Documentation

◆ Create()

bool Dwm::Credence::ChallengeResponse::Create ( const std::string & signingKey,
const Challenge & challenge )

Given a challenge, creates the response using the given signingKey.

Returns true on success, false on failure.

◆ Read()

std::istream & Dwm::Credence::ChallengeResponse::Read ( std::istream & is)

Reads the challenge response from the given istream is.

Returns is. is is normally a reference to an XChaCha20Poly1305::Istream (an encrypted stream).

◆ Verify()

bool Dwm::Credence::ChallengeResponse::Verify ( const std::string & publicKey,
const std::string & challengeString ) const

Using the given publicKey of the source of the response, verifies that the response was signed by the source and that the response contents matches the given challengeString.

Returns true if the response is correct, else returns false.

◆ Write()

std::ostream & Dwm::Credence::ChallengeResponse::Write ( std::ostream & os) const

Writes the challenge response to the given ostream os.

Returns os. os is normally a reference to an XChaCha20Poly1305::Ostream (an encrypted stream).


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