Ditto  1.0.8
Public Member Functions | Public Attributes | List of all members
ditto::Identity::SharedKeyIdentity Struct Reference

An identity where every device knows the same secret key. This is a simplistic authentication mode which is normally only suitable for private apps where all the users and devices are trusted. More...

Public Member Functions

 SharedKeyIdentity (std::string name, std::string key, uint64_t id)
 Construct a new SharedKeyIdentity. More...
 

Public Attributes

std::string app_name
 
std::string key
 
uint64_t site_id
 

Detailed Description

An identity where every device knows the same secret key. This is a simplistic authentication mode which is normally only suitable for private apps where all the users and devices are trusted.

Constructor & Destructor Documentation

◆ SharedKeyIdentity()

ditto::Identity::SharedKeyIdentity::SharedKeyIdentity ( std::string  name,
std::string  key,
uint64_t  id 
)

Construct a new SharedKeyIdentity.

Parameters
[in]namethe name of the app, specified in domain format, e.g. "app.ditto.live". All peers must use the same app name to communicate.
[in]keya base64-encoded DER private key. Refer to Ditto documentation for details about generating shared keys.
[in]idthe site ID for the device. For shared key mode, this can be left unspecified to choose a random number.

Member Data Documentation

◆ app_name

std::string ditto::Identity::SharedKeyIdentity::app_name

The app name associated with the identity.

◆ key

std::string ditto::Identity::SharedKeyIdentity::key

The base64-encoded DER private key associated with the identity.

◆ site_id

uint64_t ditto::Identity::SharedKeyIdentity::site_id

The site ID associated with the identity.