Add package.json for adding olm to npm
This commit is contained in:
parent
5a60e543a5
commit
411109d893
2 changed files with 47 additions and 0 deletions
25
javascript/README.md
Normal file
25
javascript/README.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
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);
|
22
javascript/package.json
Normal file
22
javascript/package.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "olm",
|
||||
"version": "0.1.0",
|
||||
"description": "An implementation of a well known cryptographic ratchet",
|
||||
"main": "olm.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/matrix-org/olm.git"
|
||||
},
|
||||
"keywords": [
|
||||
"matrix-org"
|
||||
],
|
||||
"author": "matrix.org",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/matrix-org/olm/issues"
|
||||
},
|
||||
"homepage": "https://github.com/matrix-org/olm#readme"
|
||||
}
|
Loading…
Reference in a new issue