Class ServerSideSecretStorageImpl

Implementation of Server-side secret storage.

Secret sharing is not implemented here: this class is strictly about the storage component of SSSS.

See

https://spec.matrix.org/v1.6/client-server-api/#storage

Hierarchy

  • ServerSideSecretStorageImpl

Implements

Constructors

Properties

accountDataAdapter: AccountDataClient

interface for fetching and setting account data on the server. Normally an instance of MatrixClient.

application level callbacks for retrieving secret keys

Methods

  • Get a secret from storage, and decrypt it.

    getSecretStorageKey will be called to obtain a secret storage key to decrypt the secret.

    Returns

    the decrypted contents of the secret, or "undefined" if name is not found in the user's account data.

    Parameters

    • name: string

      the name of the secret - i.e., the "event type" stored in the account data

    Returns Promise<undefined | string>

  • Check whether we have a key with a given ID.

    Returns

    Whether we have the key.

    Parameters

    • Optional keyId: string

      The ID of the key to check for. Defaults to the default key ID if not provided.

    Returns Promise<boolean>

  • Store an encrypted secret on the server.

    Details of the encryption keys to be used must previously have been stored in account data (for example, via addKey. getSecretStorageKey will be called to obtain a secret storage key to decrypt the secret.

    Parameters

    • name: string

      The name of the secret - i.e., the "event type" to be stored in the account data

    • secret: string

      The secret contents.

    • Optional keys: null | string[]

      The IDs of the keys to use to encrypt the secret, or null/undefined to use the default key.

    Returns Promise<void>

Generated using TypeDoc