Options
All
  • Public
  • Public/Protected
  • All
Menu

A device represents a E2EE capable client of an user.

Hierarchy

  • Device

Index

Constructors

Properties

algorithms: any[]

Get the list of algorithms this device supports.

Returns Array<EncryptionAlgorithm>.

curve25519Key: undefined | Curve25519PublicKey

Get the Curve25519 key of the given device.

deviceId: DeviceId

The unique ID of the device.

displayName: undefined | string

Get the human readable name of the device.

ed25519Key: undefined | Ed25519PublicKey

Get the Ed25519 key of the given device.

isDehydrated: boolean

Whether or not the device is a dehydrated device.

keys: Map<any, any>

Get a map containing all the device keys.

localTrustState: LocalTrust

Get the trust state of the device.

signatures: Signatures

Get a map containing all the device signatures.

userId: UserId

The user ID of the device owner.

Methods

  • encryptToDeviceEvent(event_type: string, content: any): Promise<string>
  • Encrypt a to-device message to be sent to this device, using Olm encryption.

    Prior to calling this method you must ensure that an Olm session is available for the target device. This can be done by calling OlmMachine.getMissingSessions.

    The caller is responsible for sending the encrypted event to the target device. If multiple messages are encrypted for the same device using this method they should be sent in the same order as they are encrypted.

    Returns

    Returns a promise for a JSON string containing the content of an encrypted event, which be used to create the payload for a /sendToDevice API.

    Parameters

    • event_type: string
    • content: any

    Returns Promise<string>

  • firstTimeSeen(): bigint
  • Timestamp representing the first time this device has been seen (in milliseconds).

    Returns bigint

  • free(): void
  • Returns void

  • Get the key of the given key algorithm belonging to this device.

    Parameters

    Returns undefined | DeviceKey

  • isBlacklisted(): boolean
  • Is the device locally marked as blacklisted?

    Blacklisted devices won’t receive any group sessions.

    Returns boolean

  • isCrossSignedByOwner(): boolean
  • Is this device cross-signed by its owner?

    Returns boolean

  • isCrossSigningTrusted(): boolean
  • Is this device considered to be verified using cross signing.

    Returns boolean

  • isDeleted(): boolean
  • Is the device deleted?

    Returns boolean

  • isLocallyTrusted(): boolean
  • Is the device locally marked as trusted?

    Returns boolean

  • isVerified(): boolean
  • Is this device considered to be verified.

    This method returns true if either the is_locally_trusted method returns true or if the is_cross_signing_trusted method returns true.

    Returns boolean

  • requestVerification(methods?: any[]): any[]
  • Request an interactive verification with this device.

    Returns a 2-element array [VerificationRequest, ToDeviceRequest].

    Parameters

    • Optional methods: any[]

    Returns any[]

  • setLocalTrust(local_state: LocalTrust): Promise<any>
  • Set the local trust state of the device to the given state.

    This won’t affect any cross signing trust state, this only sets a flag marking to have the given trust state.

    trust_state represents the new trust state that should be set for the device.

    Parameters

    Returns Promise<any>

  • verify(): Promise<any>
  • Mark this device as verified. Works only if the device is owned by the current user.

    Returns a signature upload request that needs to be sent out.

    Returns Promise<any>

Generated using TypeDoc