Class CrossSigningInfo

Hierarchy

  • CrossSigningInfo

Constructors

Properties

cacheCallbacks: ICacheCallbacks = {}

Callbacks used to interact with the cache

callbacks: ICryptoCallbacks = {}

Callbacks used to interact with the app Requires getCrossSigningKey and saveCrossSigningKeys

crossSigningVerifiedBefore: boolean = false
firstUse: boolean = true
keys: Record<string, ICrossSigningKey> = {}
userId: string

the user that the information is about

Methods

  • 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

    Returns

    An array with [ public key, Olm.PkSigning ]

    Parameters

    • type: string

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

    • Optional expectedPubkey: string

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

    Returns Promise<[string, PkSigning]>

  • Get cross-signing private keys from the local cache.

    Returns

    A map from key type (string) to private key (Uint8Array)

    Returns Promise<Map<string, Uint8Array>>

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

    Returns

    the ID

    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

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

    Returns

    True if all keys are stored in the local cache.

    Parameters

    • Optional type: string

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

    Returns Promise<boolean>

  • 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...

    Returns

    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

    Parameters

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

  • 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.

    Returns

    The private key

    Parameters

    • type: string

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

    • secretStorage: SecretStorage<MatrixClient>

      The secret store using account data

    Returns Promise<null | Uint8Array>

  • Store private keys in secret storage for use by other devices. This is typically called in conjunction with the creation of new cross-signing keys.

    Parameters

    • keys: Map<string, Uint8Array>

      The keys to store

    • secretStorage: SecretStorage<undefined>

      The secret store using account data

    Returns Promise<void>

Generated using TypeDoc