Olm m.room.encrypted example

This commit is contained in:
Valentin Deniaud 2018-07-17 22:39:45 +02:00
parent 8732378da2
commit 661176cb3a
3 changed files with 37 additions and 13 deletions

View file

@ -1,7 +1,7 @@
{ {
"content": { "content": {
"algorithm": "m.megolm.v1.aes-sha2", "algorithm": "m.megolm.v1.aes-sha2",
"ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg2yyOwAtHaZTwyNg37afzg8f3r9IsN9rH4RNFg7MaZencUJe4qvELiDiopUjy5wYVDAtqdBzer5bWRD9ldxp1FLgbQvBcjkkywYjCsmsq6+hArILd9oAQZnGKn/qLsK+5uNX3PaWzDRC9wZPQvWYYPCTov3jCwXKTPsLKIiTrcCXDqMvnn8m+T3zF1/I2zqxg158tnUwWWIw51UO", "ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg...",
"device_id": "RJYKSTBOIE", "device_id": "RJYKSTBOIE",
"sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA", "sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA",
"session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ" "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ"
@ -10,9 +10,5 @@
"room_id": "!Cuyf34gef24t:localhost", "room_id": "!Cuyf34gef24t:localhost",
"origin_server_ts": 1476648761524, "origin_server_ts": 1476648761524,
"sender": "@example:localhost", "sender": "@example:localhost",
"type": "m.room.encrypted", "type": "m.room.encrypted"
"unsigned": {
"age": 158,
"transaction_id": "m1476648745605.19"
}
} }

View file

@ -0,0 +1,14 @@
{
"type": "m.room.encrypted",
"sender": "@example:localhost",
"content": {
"algorithm": "m.olm.v1.curve25519-aes-sha2",
"sender_key": "Szl29ksW/L8yZGWAX+8dY1XyFi+i5wm+DRhTGkbMiwU",
"ciphertext": {
"7qZcfnBmbEGzxxaWfBjElJuvn7BZx+lSz/SvFrDF/z8": {
"type": 0,
"body": "AwogGJJzMhf/S3GQFXAOrCZ3iKyGU5ZScVtjI0KypTYrW..."
}
}
}
}

View file

@ -1,8 +1,6 @@
--- ---
allOf: allOf:
# this is a bit of a lie; if the event is sent as a to-device event it won't - $ref: core-event-schema/event.yaml
# have the room event fields. We really ought to use different event types :/
- $ref: core-event-schema/room_event.yaml
description: |- description: |-
This event type is used when sending encrypted events. It can be used either This event type is used when sending encrypted events. It can be used either
@ -14,16 +12,32 @@ properties:
properties: properties:
algorithm: algorithm:
type: string type: string
enum:
- m.olm.curve25519-aes-sha256
- m.megolm.v1.aes-sha
description: |- description: |-
The encryption algorithm used to encrypt this event. The The encryption algorithm used to encrypt this event. The
value of this field determines which other properties will be value of this field determines which other properties will be
present. present.
ciphertext: ciphertext:
type: oneOf:
- object - type: string
- string - type: object
additionalProperties:
type: object
title: CiphertextInfo
properties:
body:
type: string
description: The encrypted payload.
type:
type: integer
description: The Olm message type.
description: |- description: |-
Normally required. The encrypted content of the event. The encrypted content of the event. Either the encrypted payload
itself, in the case of a Megolm event, or a map from the recipient
Curve25519 identity key to ciphertext information, in the case of an
Olm event. For more details, see `Messaging Algorithms`_.
required: required:
- algorithm - algorithm
type: object type: object