olm/javascript
2015-08-04 11:55:04 +01:00
..
build.py Don't pass a key id when creating a new outbound session 2015-07-08 16:04:18 +01:00
demo.html Output simpler JSON for the account keys, don't sign the JSON but instead provide a olm_account_sign method so that the user of the library can sign the JSON themselves 2015-07-10 11:57:53 +01:00
olm_post.js Add sha256 and ed25519_verify methods to javascript bindings 2015-08-04 11:55:04 +01:00
olm_pre.js Add more workarounds for closure compiler in javascript bindings 2015-07-21 14:30:46 +01:00
package.json Add package.json for adding olm to npm 2015-07-21 15:04:27 +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);