aboutsummaryrefslogtreecommitdiff
path: root/javascript/README.md
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-05-26 13:58:14 +0100
committerRichard van der Hoff <richard@matrix.org>2016-05-26 13:58:14 +0100
commit952a3e15cf498b21eef9a13152ca704bca2f9723 (patch)
tree02e80f655ceaf09f5028ef80242aaddd223d1e8b /javascript/README.md
parent09b8c3d7bc9e62760ed17575159de655e90b399b (diff)
parent389a181ea860107aad3f657bc54476fc3b824080 (diff)
Merge branch 'rav/group_chat_js_bindings'
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);