Construct a new SecretStorage
.
Normally, it is unnecessary to call this directly, since MatrixClient automatically constructs one.
However, it may be useful to construct a new SecretStorage
, if custom callbacks
are required, for example.
interface for fetching and setting account data on the server. Normally an instance of MatrixClient.
application level callbacks for retrieving secret keys
Private
Readonly
accountinterface for fetching and setting account data on the server. Normally an instance of MatrixClient.
Private
Readonly
callbacksapplication level callbacks for retrieving secret keys
Add a key for encrypting secrets.
An object with: keyId: the ID of the key keyInfo: details about the key (iv, mac, passphrase)
the algorithm used by the key.
the options for the algorithm. The properties used depend on the algorithm given.
Optional
keyId: stringthe ID of the key. If not given, a random ID will be generated.
Check whether a key matches what we expect based on the key info
whether or not the key matches
the key to check
the key info
Get a secret from storage, and decrypt it.
getSecretStorageKey will be called to obtain a secret storage key to decrypt the secret.
the decrypted contents of the secret, or "undefined" if name
is not found in
the user's account data.
the name of the secret - i.e., the "event type" stored in the account data
Get the key information for a given ID.
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?
Optional
keyId: null | stringThe ID of the key to check for. Defaults to the default key ID if not provided.
Private
getCheck if a secret is stored on the server.
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
the name of the secret
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.
The name of the secret - i.e., the "event type" to be stored in the account data
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.
Generated using TypeDoc
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