Constructors

Properties

firstUse: boolean = true
keys: Record<string, CrossSigningKeyInfo> = {}
userId: string

the user that the information is about

Methods

  • Check whether a given device is trusted.

    Parameters

    • userCrossSigning: CrossSigningInfo

      Cross signing info for user

    • device: DeviceInfo

      The device to check

    • localTrust: boolean

      Whether the device is trusted locally

    • trustCrossSignedDevices: boolean

      Whether we trust cross signed devices

    Returns DeviceTrustLevel

  • unsets the keys, used when another session has reset the keys, to disable cross-signing

    Returns void

  • Calls the app callback to ask for a private key

    Parameters

    • type: string

      The key type ("master", "self_signing", or "user_signing")

    • OptionalexpectedPubkey: string

      The matching public key or undefined to use the stored public key for the given key type.

    Returns Promise<[string, PkSigning]>

    An array with [ public key, Olm.PkSigning ]

  • Get the ID used to identify the user. This can also be used to test for the existence of a given key type.

    Parameters

    • type: string = "master"

      The type of key to get the ID of. One of "master", "self_signing", or "user_signing". Defaults to "master".

    Returns null | string

    the ID

  • Check whether the private keys exist in the local key cache.

    Parameters

    • Optionaltype: string

      The type of key to get. One of "master", "self_signing", or "user_signing". Optional, will check all by default.

    Returns Promise<boolean>

    True if all keys are stored in the local cache.

  • Check whether the private keys exist in secret storage. XXX: This could be static, be we often seem to have an instance when we want to know this anyway...

    Parameters

    Returns Promise<null | Record<string, object>>

    map of key name to key info the secret is encrypted with, or null if it is not present or not encrypted with a trusted key

  • Create new cross-signing keys for the given key types. The public keys will be held in this class, while the private keys are passed off to the saveCrossSigningKeys application callback.

    Parameters

    Returns Promise<void>

  • Parameters

    • isCrossSigningVerified: boolean

    Returns void

  • Get private keys from secret storage created by some other device. This also passes the private keys to the app-specific callback.

    Parameters

    • type: string

      The type of key to get. One of "master", "self_signing", or "user_signing".

    • secretStorage: ServerSideSecretStorage

      The secret store using account data

    Returns Promise<null | Uint8Array>

    The private key