olm/javascript
Richard van der Hoff d4c8aae803 Add support for building the JS wrappers to the Makefile
Now that we have C and C++, we need to split the compile and link steps
(because we need different flags for the C and C++ files), so this is
easier with a Makefile.
2016-05-20 15:15:40 +01:00
..
.gitignore Make 'npm build' build the js lib 2016-04-26 12:12:08 +01:00
demo.html Add some logging to help understand what's going on 2016-04-26 17:55:26 +01:00
olm_post.js Remove vestiges of logging 2016-05-16 11:50:44 +01:00
olm_pre.js Fix a console error when importing in a browser 2015-12-02 14:06:01 +00:00
package.json Add support for building the JS wrappers to the Makefile 2016-05-20 15:15:40 +01:00
README.md Add package.json for adding olm to npm 2015-07-21 15:04:27 +01:00

Olm

Example:

var alice = new Olm.Account();
var bob = new Olm.Account();
alice.create();
bob.create();
bob.generate_one_time_keys(1);

var bobs_id_keys = JSON.parse(bob.identity_keys());
var bobs_id_key = bobs_id_keys.curve25519;
var bobs_ot_keys = JSON.parse(bob.one_time_keys());
for (key in bobs_ot_keys.curve25519) {
    var bobs_ot_key = bobs_ot_keys.curve25519[key];
}

alice_session = new Olm.Session();
alice_session.create_outbound(alice, bobs_id_key, bobs_ot_key);
alice_message = a_session.encrypt("Hello");

bob_session.create_inbound(bob, bob_message);
var plaintext = bob_session.decrypt(message_1.type, bob_message);
bob.remove_one_time_keys(bob_session);