Class: module:crypto/deviceinfo

module:crypto/deviceinfo

new module:crypto/deviceinfo(deviceId)

Information about a user's device
Parameters:
Name Type Description
deviceId string id of the device
Properties:
Name Type Description
deviceId string the ID of this device
algorithms Array.<string> list of algorithms supported by this device
keys Object.<string, string> a map from <key type>:<id> -> <base64-encoded key>>
verified module:crypto/deviceinfo.DeviceVerification whether the device has been verified by the user
unsigned Object additional data from the homeserver
Source:

Members

(static) DeviceVerification

Properties:
Name Type Description
VERIFIED
UNVERIFIED
BLOCKED
Source:

Methods

(static) fromStorage(obj, deviceId) → {module:crypto~DeviceInfo}

rehydrate a DeviceInfo from the session store
Parameters:
Name Type Description
obj object raw object from session store
deviceId string id of the device
Source:
Returns:
new DeviceInfo
Type
module:crypto~DeviceInfo

getDisplayName() → (nullable) {string}

Get the configured display name for this device, if any
Source:
Returns:
displayname
Type
string

getFingerprint() → {string}

Get the fingerprint for this device (ie, the Ed25519 key)
Source:
Returns:
base64-encoded fingerprint of this device
Type
string

getIdentityKey() → {string}

Get the identity key for this device (ie, the Curve25519 key)
Source:
Returns:
base64-encoded identity key of this device
Type
string

isBlocked() → {Boolean}

Returns true if this device is blocked
Source:
Returns:
true if blocked
Type
Boolean

isVerified() → {Boolean}

Returns true if this device is verified
Source:
Returns:
true if verified
Type
Boolean

toStorage() → {object}

Prepare a DeviceInfo for JSON serialisation in the session store
Source:
Returns:
deviceinfo with non-serialised members removed
Type
object