Methods
(static) clearSessionStore()
- Source:
Clear all signal session cipher records.
(static) get(ns, key, defaultValueopt) → {*}
- Source:
Get a value from the current
module:storage/backing~StorageInterface
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ns |
string | Namespace for the store. | |
key |
string | ||
defaultValue |
* |
<optional> |
Value to return if key is not present. |
Returns:
Decoded value from the current
module:storage/backing~StorageInterface
- Type
- *
(static) getDeviceIds() → {Array.<number>}
- Source:
Get the current known list of device IDs for a peer.
Returns:
- Type
- Array.<number>
(static) getOurIdentity() → {KeyPair}
- Source:
Returns:
The current user's identity key pair.
- Type
- KeyPair
(static) getOurRegistrationId() → (nullable) {number}
- Source:
Returns:
The current user's registration identifier.
- Type
- number
(static) getState(key, defaultValueopt) → {*}
- Source:
Get a global state value from the
module:storage/backing~StorageInterface
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | ||
defaultValue |
* |
<optional> |
Value to return if key is not present. |
Returns:
- Type
- *
(static) has(ns, key) → {boolean}
- Source:
Test if a key is present in the current
module:storage/backing~StorageInterface
.
Parameters:
Name | Type | Description |
---|---|---|
ns |
string | Namespace for the store. |
key |
string |
Returns:
- True if the key is present.
- Type
- boolean
(static) initialize()
- Source:
Initialize the current
module:storage/backing~StorageInterface
(static) isBlocked(addr) → {boolean}
- Source:
Indicates if an address is considered to be "blocked". Generally this means
message handling will be aborted for this address.
Parameters:
Name | Type | Description |
---|---|---|
addr |
string | Address of peer. |
Returns:
- Type
- boolean
(static) isTrustedIdentity(identifier, publicKey) → {boolean}
- Source:
Determine if a peer's public identity key matches our records.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
string | Address of peer |
publicKey |
Buffer | Public key to test. |
Returns:
- Type
- boolean
(static) keys(ns, reopt) → {Array.<string>}
- Source:
Scan the
module:storage/backing~StorageInterface
for keys.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ns |
string | Namespace for the store. | |
re |
RegExp |
<optional> |
Regular expression filter. |
Returns:
- Array of matching keys.
- Type
- Array.<string>
(static) loadIdentity(identifier) → (nullable) {Buffer}
- Source:
Load our last known identity key for a peer.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
string | Address of peer |
Returns:
Public identity key for peer
- Type
- Buffer
(static) loadPreKey(keyId) → (nullable) {KeyPair}
- Source:
Get a prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number |
Returns:
- Type
- KeyPair
(static) loadSession(encodedAddr) → (nullable) {libsignal.SessionRecord}
- Source:
Load a signal cipher session for a peer.
Parameters:
Name | Type | Description |
---|---|---|
encodedAddr |
EncodedUserAddress |
Returns:
- Type
- libsignal.SessionRecord
(static) loadSignedPreKey(keyId) → (nullable) {KeyPair}
- Source:
Get a signed prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number |
Returns:
- Type
- KeyPair
(static) putState(key, value)
- Source:
Set a global state value in the
module:storage/backing~StorageInterface
.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | |
value |
* |
(static) remove(ns, key)
- Source:
Remove an entry from the current
module:storage/backing~StorageInterface
.
Parameters:
Name | Type | Description |
---|---|---|
ns |
string | Namespace for the store. |
key |
string |
(static) removeAllSessions(addr)
- Source:
Remove all signal session cipher records for a peer.
Parameters:
Name | Type | Description |
---|---|---|
addr |
string | UUID of peer. |
(static) removeIdentity()
- Source:
Remove the current trusted public identity key for a peer.
(static) removeOurIdentity()
- Source:
Remove the current user's identity key pair.
(static) removePreKey(keyId)
- Source:
Remove a prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number |
(static) removeSession(encodedAddr)
- Source:
Remove a signal session cipher record for a peer.
Parameters:
Name | Type | Description |
---|---|---|
encodedAddr |
EncodedUserAddress |
(static) removeSignedPreKey(keyId)
- Source:
Remove a signed prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number |
(static) removeState(key)
- Source:
Remove a value from the state store.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
(static) saveIdentity(identifier, publicKey)
- Source:
Store a new trusted public identity key for a peer.
Parameters:
Name | Type | Description |
---|---|---|
identifier |
string | Address of peer |
publicKey |
Buffer | Public identity key for peer |
(static) saveOurIdentity(keyPair)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
keyPair |
KeyPair | New identity key pair for current user. |
(static) set(ns, key, value)
- Source:
Set a value in the current
module:storage/backing~StorageInterface
.
Parameters:
Name | Type | Description |
---|---|---|
ns |
string | Namespace for the store. |
key |
string | |
value |
* |
(static) setBacking(Backing)
- Source:
Set the default
module:storage/backing~StorageInterface
to use for
further storage operations.
Parameters:
Name | Type | Description |
---|---|---|
Backing |
module:storage/backing~StorageInterface | string | Class or string label. |
(static) setLabel(label)
- Source:
Set the label to use within the current
module:storage/backing~StorageInterface
. This is an ideal way of
partitioning a single store for multiple users. E.g sharing the
same database instance for more than one librelay based application.
Parameters:
Name | Type | Description |
---|---|---|
label |
string |
(static) shutdown()
- Source:
Shutdown the current
module:storage/backing~StorageInterface
.
(static) storePreKey(keyId, keyPair)
- Source:
Store a new prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number | |
keyPair |
KeyPair |
(static) storeSession(encodedAddr) → {libsignal.SessionRecord}
- Source:
Store a signal cipher session for a peer.
Parameters:
Name | Type | Description |
---|---|---|
encodedAddr |
EncodedUserAddress |
Returns:
record
- Type
- libsignal.SessionRecord
(static) storeSignedPreKey(keyId, keyPair)
- Source:
Store a new signed prekey pair for the current user.
Parameters:
Name | Type | Description |
---|---|---|
keyId |
number | |
keyPair |
KeyPair |