aboutsummaryrefslogtreecommitdiff
path: root/olm.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-08 15:30:34 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-08 15:30:34 +0100
commit532dc0d4e79192a0c7fd1758322f6cae06959859 (patch)
treed8c553a7601c2688e04c74aed36979478d9f9f71 /olm.py
parentdceae043b30efb672acf41b21fbb335a6710b3c1 (diff)
Change the JSON format for one time keys to include what algorithm they are for
Diffstat (limited to 'olm.py')
-rwxr-xr-xolm.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/olm.py b/olm.py
index a77ae63..0666a93 100755
--- a/olm.py
+++ b/olm.py
@@ -297,8 +297,8 @@ if __name__ == '__main__':
create_account.set_defaults(func=do_create_account)
keys = commands.add_parser("keys", help="List public keys for an account")
- keys.add_argument("--user-id", default="A User ID")
- keys.add_argument("--device-id", default="A Device ID")
+ keys.add_argument("--user-id", default="@user:example.com")
+ keys.add_argument("--device-id", default="default_device_id")
keys.add_argument("--valid-after", default=0, type=int)
keys.add_argument("--valid-until", default=0, type=int)
keys.add_argument("account_file", help="Local account file")
@@ -311,18 +311,11 @@ if __name__ == '__main__':
"device_keys": account.identity_keys(
args.user_id, args.device_id,
args.valid_after, args.valid_until,
- )
- }
- ot_keys = account.one_time_keys()
- result2 = {
- "one_time_keys": [{
- "keyId": k[0],
- "publicKey": str(k[1]),
- } for k in ot_keys[1:]]
+ ),
+ "one_time_keys": account.one_time_keys(),
}
try:
yaml.safe_dump(result1, sys.stdout, default_flow_style=False)
- yaml.dump(result2, sys.stdout, default_flow_style=False)
except:
pass