Ditto  1.0.8
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DittoSDK.DittoIdentity Struct Reference

Used to identify a given peer in your network. In practice a peer may be a user, a device, or it might be some other entity in your system. More...

Inheritance diagram for DittoSDK.DittoIdentity:

Public Member Functions

unsafe void Dispose ()
 

Static Public Member Functions

static DittoIdentity Development (string appName="", uint siteId=0)
 Creates a development identity using the provided app name and site ID. If an app name or site ID isn't provided then the SDK will use generated values for them. More...
 
static DittoIdentity Production (string certificateConfig)
 Creates a production identity using the provided certificate config. More...
 
static DittoIdentity SharedKey (string appName, string sharedKey, uint siteId=0)
 Creates a shared key identity using the provided app name, private key and site id. If a site ID isn't provided then the SDK will generate a random value. More...
 

Public Attributes

readonly DittoIdentityType Type
 The type of the identity. More...
 
readonly string AppName
 The app name. More...
 
readonly uint SiteId
 The site ID. More...
 
readonly string Key
 The shared private key. More...
 
readonly string CertificateConfig
 A base64 encoded string representation of a certificate bundle. More...
 

Detailed Description

Used to identify a given peer in your network. In practice a peer may be a user, a device, or it might be some other entity in your system.

You can get up and running quickly by using a development identity and then change to using a production identity when you are preparing to deploying Ditto to production.

Member Function Documentation

◆ Development()

static DittoIdentity DittoSDK.DittoIdentity.Development ( string  appName = "",
uint  siteId = 0 
)
inlinestatic

Creates a development identity using the provided app name and site ID. If an app name or site ID isn't provided then the SDK will use generated values for them.

Parameters
appNameUse this to ensure that connections between devices are only established if they share the same app name.
siteIdUse this to identity different users or devices. Site IDs are persisted between sessions when using a development identity. Site IDs should be unique and not reused by different users or devices.
Returns
A DittoIdentity suitable for use in a development environment.

◆ Production()

static DittoIdentity DittoSDK.DittoIdentity.Production ( string  certificateConfig)
inlinestatic

Creates a production identity using the provided certificate config.

Parameters
certificateConfigA base64 encoded string representation of a certificate bundle.
Returns
A DittoIdentity suitable for use in a production environment.

◆ SharedKey()

static DittoIdentity DittoSDK.DittoIdentity.SharedKey ( string  appName,
string  sharedKey,
uint  siteId = 0 
)
inlinestatic

Creates a shared key identity using the provided app name, private key and site id. If a site ID isn't provided then the SDK will generate a random value.

Parameters
appNameUse this to ensure that connections between devices are only established if they share the same app name.
sharedKeyA base64 DER-encoded private key. Refer to the Ditto documentation for full requirements for shared keys and how to generate them.
siteIdUse this to identity different users or devices. Site IDs are persisted between sessions when using a development identity. Site IDs should be unique and not reused by different users or devices.
Returns
A DittoIdentity suitable for use in a shared key environment.

Member Data Documentation

◆ AppName

readonly string DittoSDK.DittoIdentity.AppName

The app name.

Use this to ensure that connections between devices are only established if they share the same app name.

Note that this is only set if the identity is a development identity.

◆ CertificateConfig

readonly string DittoSDK.DittoIdentity.CertificateConfig

A base64 encoded string representation of a certificate bundle.

Note that this is only set if the identity is a production identity.

◆ Key

readonly string DittoSDK.DittoIdentity.Key

The shared private key.

Include this in your privately-distributed app to provide security against third parties while allowing your devices to connect to each other.

Note that this is only set if the identity is a shared key identity.

◆ SiteId

readonly uint DittoSDK.DittoIdentity.SiteId

The site ID.

Use this to identity different users or devices. Site IDs are persisted between sessions if using a development identity.

Site IDs should be unique and not reused by different users or devices.

Note that this is only set if the identity is a development identity.

◆ Type

readonly DittoIdentityType DittoSDK.DittoIdentity.Type

The type of the identity.