aboutsummaryrefslogtreecommitdiff
path: root/javascript/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/README.md')
-rw-r--r--javascript/README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/javascript/README.md b/javascript/README.md
index 6902e36..6ed9bbb 100644
--- a/javascript/README.md
+++ b/javascript/README.md
@@ -22,4 +22,21 @@ Example:
bob_session.create_inbound(bob, bob_message);
var plaintext = bob_session.decrypt(message_1.type, bob_message);
- bob.remove_one_time_keys(bob_session); \ No newline at end of file
+ bob.remove_one_time_keys(bob_session);
+
+
+Group chat:
+
+ var outbound_session = new Olm.OutboundGroupSession();
+ outbound_session.create();
+
+ // exchange these over a secure channel
+ var session_id = group_session.session_id();
+ var session_key = group_session.session_key();
+ var message_index = group_session.message_index();
+
+ var inbound_session = new Olm.InboundGroupSession();
+ inbound_session.create(message_index, session_key);
+
+ var ciphertext = outbound_session.encrypt("Hello");
+ var plaintext = inbound_session.decrypt(ciphertext);