libkazv
Loading...
Searching...
No Matches
Kazv::SasDesc Class Reference

#include <sas-desc.hpp>

Classes

struct  Private
 

Public Member Functions

 SasDesc ()
 Construct an invalid SAS description.
 
 SasDesc (RandomTag, RandomData r)
 Construct a random SAS description.
 
 SasDesc (SasDesc &&that)
 
SasDescoperator= (SasDesc &&that)
 
 ~SasDesc ()
 
void emplace (RandomTag, RandomData r)
 Replace this with a random SAS description.
 
bool valid () const
 
std::string publicKey () const
 
void setTheirKey (std::string theirPublicKey)
 Set the key of the other party.
 
std::pair< immer::array< int >, immer::array< int > > getDisplayCodesCurve25519HkdfSha256 (std::string starterUserId, std::string starterDeviceId, std::string starterKey, std::string accepterUserId, std::string accepterDeviceId, std::string accepterKey, std::string txnId) const
 
std::string getKeyMacHkdfHMacSha256V2 (std::string key, std::string ourUserId, std::string ourDeviceId, std::string theirUserId, std::string theirDeviceId, std::string txnId, std::string keyId) const
 Get the mac for a key using hkdf-hmac-sha256.v2.
 
bool verifyKeyMacHkdfHMacSha256V2 (std::string mac, std::string key, std::string ourUserId, std::string ourDeviceId, std::string theirUserId, std::string theirDeviceId, std::string txnId, std::string keyId) const
 
std::string getKeyListMacHkdfHMacSha256V2 (std::set< std::string > keyList, std::string ourUserId, std::string ourDeviceId, std::string theirUserId, std::string theirDeviceId, std::string txnId) const
 Get the mac for a key list using hkdf-hmac-sha256.v2.
 
bool verifyKeyListMacHkdfHMacSha256V2 (std::string mac, std::set< std::string > keyList, std::string ourUserId, std::string ourDeviceId, std::string theirUserId, std::string theirDeviceId, std::string txnId) const
 

Static Public Member Functions

static std::size_t constructRandomSize ()
 

Constructor & Destructor Documentation

◆ SasDesc() [1/3]

Kazv::SasDesc::SasDesc ( )

Construct an invalid SAS description.

◆ SasDesc() [2/3]

Kazv::SasDesc::SasDesc ( RandomTag  ,
RandomData  r 
)

Construct a random SAS description.

◆ SasDesc() [3/3]

Kazv::SasDesc::SasDesc ( SasDesc &&  that)
default

◆ ~SasDesc()

Kazv::SasDesc::~SasDesc ( )
default

Member Function Documentation

◆ constructRandomSize()

std::size_t Kazv::SasDesc::constructRandomSize ( )
static

◆ emplace()

void Kazv::SasDesc::emplace ( RandomTag  ,
RandomData  r 
)

Replace this with a random SAS description.

◆ getDisplayCodesCurve25519HkdfSha256()

std::pair< immer::array< int >, immer::array< int > > Kazv::SasDesc::getDisplayCodesCurve25519HkdfSha256 ( std::string  starterUserId,
std::string  starterDeviceId,
std::string  starterKey,
std::string  accepterUserId,
std::string  accepterDeviceId,
std::string  accepterKey,
std::string  txnId 
) const

◆ getKeyListMacHkdfHMacSha256V2()

std::string Kazv::SasDesc::getKeyListMacHkdfHMacSha256V2 ( std::set< std::string >  keyList,
std::string  ourUserId,
std::string  ourDeviceId,
std::string  theirUserId,
std::string  theirDeviceId,
std::string  txnId 
) const

Get the mac for a key list using hkdf-hmac-sha256.v2.

Parameters
keyListA set containing the key ids.

◆ getKeyMacHkdfHMacSha256V2()

std::string Kazv::SasDesc::getKeyMacHkdfHMacSha256V2 ( std::string  key,
std::string  ourUserId,
std::string  ourDeviceId,
std::string  theirUserId,
std::string  theirDeviceId,
std::string  txnId,
std::string  keyId 
) const

Get the mac for a key using hkdf-hmac-sha256.v2.

Parameters
keyThe unpadded base64-encoded public key.
keyIdThe key id for the key.

◆ operator=()

SasDesc & Kazv::SasDesc::operator= ( SasDesc &&  that)
default

◆ publicKey()

std::string Kazv::SasDesc::publicKey ( ) const

◆ setTheirKey()

void Kazv::SasDesc::setTheirKey ( std::string  theirPublicKey)

Set the key of the other party.

◆ valid()

bool Kazv::SasDesc::valid ( ) const
Returns
Whether this SAS is in a valid state.

◆ verifyKeyListMacHkdfHMacSha256V2()

bool Kazv::SasDesc::verifyKeyListMacHkdfHMacSha256V2 ( std::string  mac,
std::set< std::string >  keyList,
std::string  ourUserId,
std::string  ourDeviceId,
std::string  theirUserId,
std::string  theirDeviceId,
std::string  txnId 
) const

◆ verifyKeyMacHkdfHMacSha256V2()

bool Kazv::SasDesc::verifyKeyMacHkdfHMacSha256V2 ( std::string  mac,
std::string  key,
std::string  ourUserId,
std::string  ourDeviceId,
std::string  theirUserId,
std::string  theirDeviceId,
std::string  txnId,
std::string  keyId 
) const

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