SharedKey

class SharedKey @JvmOverloads() constructor(dependencies: DittoDependencies, appName: String, sharedKey: String, siteID: BigInteger?) : DittoIdentity

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.

Parameters

dependencies

the dependencies required by the SDK to be initialised.

appName

the name of the app, specified in domain format, e.g. "app.ditto.live". All peers must use the same app name to communicate.

sharedKey

a base64-encoded DER private key. Refer to Ditto documentation for details about generating shared keys.

siteID

the site ID for the device. For shared key mode, this can be left unspecified to choose a random number.

Constructors

SharedKey
Link copied to clipboard
fun SharedKey(dependencies: DittoDependencies, appName: String, sharedKey: String, siteID: BigInteger? = null)
the dependencies required by the SDK to be initialised.

Functions

close
Link copied to clipboard
fun close()

Properties

appName
Link copied to clipboard
val appName: String
the name of the app, specified in domain format, e.g.
authClient
Link copied to clipboard
var authClient: SWIGTYPE_p_CAuthClient? = null
dependencies
Link copied to clipboard
val dependencies: DittoDependencies
the dependencies required by the SDK to be initialised.
sharedKey
Link copied to clipboard
val sharedKey: String
a base64-encoded DER private key.
siteID
Link copied to clipboard
val siteID: BigInteger? = null
the site ID for the device.