Curve25519 key for the account, unknown until we load the account from storage in init()
Ed25519 key for the account, unknown until we load the account from storage in init()
Add an inbound group session to the session store
room in which this session will be used
base64-encoded curve25519 key of the sender
Devices involved in forwarding this session to us.
session identifier
base64-encoded secret key
Other keys the sender claims.
true if the megolm keys are in export format (ie, they lack an ed25519 signature)
any other data to be include with the session
Record in the data store why an inbound group session was withheld.
room that the session belongs to
base64-encoded curve25519 key of the sender
session identifier
reason code
human-readable version of code
Generate a new inbound session, given an incoming message
remote user's Curve25519 identity key
messageType field from the received message (must be 0)
base64-encoded body from the received message
decrypted payload, and session id of new session
Generate a new outbound session
The new session will be stored in the cryptoStore.
remote user's Curve25519 identity key
remote user's one-time Curve25519 key
sessionId for the outbound session.
Decrypt a received message with an inbound group session
room in which the message was received
base64-encoded curve25519 key of the sender
session identifier
base64-encoded body of the encrypted message
ID of the event being decrypted
timestamp of the event being decrypted
null if the sessionId is unknown
Decrypt an incoming message using an existing session
Curve25519 identity key for the remote device
the id of the active session
messageType field from the received message
base64-encoded body from the received message
decrypted payload.
Encrypt an outgoing message using an existing session
Curve25519 identity key for the remote device
the id of the active session
payload to be encrypted and sent
ciphertext
Export data for re-creating the Olm device later. TODO export data other than just account and (P2P) sessions.
The exported data
Export an inbound group session
base64-encoded curve25519 key of the sender
session identifier
The session object from the store
exported session data
Extract the keys to a given megolm session, for sharing
room in which the message was received
base64-encoded curve25519 key of the sender
session identifier
Optional
chainIndex: numberThe chain index at which to export the session. If omitted, export at the first index we know about.
details of the session key. The key is a base64-encoded megolm key in export format.
Get the current (unused, unpublished) one-time keys for this account.
one time keys; an object with the single property curve25519, which is itself an object mapping key id to Curve25519 key.
Get the session keys for an outbound group session
the id of the outbound group session
current chain index, and base64-encoded secret key.
Get the right olm session id for encrypting messages to the given identity key
Curve25519 identity key for the remote device
Don't wait for an in-progress session to complete. This should only be set to true of the calling function is the function that marked the session as being in-progress.
Optional
log: LoggerA possibly customised log
session id, or null if no established session
Get information on the active Olm sessions for a device.
Returns an array, with an entry for each active session. The first entry in the result will be the one used for outgoing messages. Each entry contains the keys 'hasReceivedMessage' (true if the session has received an incoming message and is therefore past the pre-key stage), and 'sessionId'.
Curve25519 identity key for the device
Don't wait for an in-progress session to complete. This should only be set to true of the calling function is the function that marked the session as being in-progress.
A possibly customised log
Determine if we have the keys for a given megolm session
room in which the message was received
base64-encoded curve25519 key of the sender
session identifier
true if we have the keys to this session
Initialise the OlmAccount. This must be called before any other operations on the OlmDevice.
Data from an exported Olm device can be provided in order to re-create this device.
Attempts to load the OlmAccount from the crypto store, or creates one if none is found.
Reads the device keys from the OlmAccount object.
opts to initialise the OlmAccount with
Determine if an incoming messages is a prekey message matching an existing session
Curve25519 identity key for the remote device
the id of the active session
messageType field from the received message
base64-encoded body from the received message
true if the received message is a prekey message which matches the given session.
Static
get
Manages the olm cryptography functions. Each OlmDevice has a single OlmAccount and a number of OlmSessions.
Accounts and sessions are kept pickled in the cryptoStore.