Class SecretStorage<B>

Implements Secure Secret Storage and Sharing (MSC1946)

Type Parameters

Hierarchy

  • SecretStorage

Constructors

Properties

accountDataAdapter: IAccountDataClient
baseApis: B
cryptoCallbacks: ICryptoCallbacks
requests: Map<string, ISecretRequestInternal> = ...

Methods

  • Get a secret from storage.

    Returns

    the contents of the secret

    Parameters

    • name: string

      the name of the secret

    Returns Promise<undefined | string>

  • Get the key information for a given ID.

    Returns

    If the key was found, the return value is an array of the form [keyId, keyInfo]. Otherwise, null is returned. XXX: why is this an array when addKey returns an object?

    Parameters

    • Optional keyId: null | string

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

    Returns Promise<null | SecretStorageKeyTuple>

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

  • Check if a secret is stored on the server.

    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

    • name: string

      the name of the secret

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

  • Store an encrypted secret on the server

    Parameters

    • name: string

      The name of the secret

    • 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