aboutsummaryrefslogtreecommitdiff
path: root/javascript/README.md
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-05-25 14:42:49 +0100
committerRichard van der Hoff <richard@matrix.org>2016-05-25 17:48:01 +0100
commit013f27f3dc8de747e82b74055c4dde55ca04b4c9 (patch)
treef285ef438ad18545be5d10526e42e38695cf0da3 /javascript/README.md
parentee8172d882e853e737ac7e8b00fb760f21e80bfe (diff)
Javascript bindings for group sessions
Diffstat (limited to 'javascript/README.md')
-rw-r--r--javascript/README.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/javascript/README.md b/javascript/README.md
index 5c2c96b..6ed9bbb 100644
--- a/javascript/README.md
+++ b/javascript/README.md
@@ -23,3 +23,20 @@ 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);
+
+
+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);