You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
matrix-spec/event-schemas/schema/m.room.message.encrypted_file

101 lines
3.1 KiB
Plaintext

---
allOf:
- $ref: core-event-schema/room_event.yaml
description: |-
This message represents an encrypted generic file, corresponding to a
plaintext ``m.file`` message. ``m.image``, ``m.video`` and ``m.audio`` can be
sent encrypted using the same structure.
properties:
content:
properties:
body:
description: |-
A human-readable description of the file. This is recommended to be
the filename of the original upload.
type: string
filename:
description: The original filename of the uploaded file.
type: string
info:
description: Information about the file referred to in ``file``.
properties:
mimetype:
description: The mimetype of the file e.g. ``application/msword``.
type: string
size:
description: The size of the file in bytes.
type: integer
thumbnail_file:
description: The URL to the thumbnail of the file.
title: EncryptedFile
type: object
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: FileInfo
type: object
msgtype:
enum:
- m.file
type: string
file:
description: Information needed to decrypt the file.
properties:
url:
description: The URL to the file.
type: string
key:
description: A `JSON web key`_ object.
type: object
title: JWK
properties:
kty:
description: Key type. Must be ``oct``.
type: string
key_ops:
description: |-
Key operations. Must at least contain ``encrypt`` and ``decrypt``.
type: array
items:
type: string
alg:
description: Algorithm. Must be ``A256CTR``.
type: string
k:
description: The key, encoded as urlsafe unpadded base64.
type: string
ext:
description: Extractable. Must be ``true``. This is a `W3C extension`_.
type: boolean
iv:
description: |-
The Initialisation Vector used by AES-CTR, encoded as unpadded
base64.
type: string
hashes:
description: |-
A map from an algorithm name to a hash of the ciphertext, encoded
as unpadded base64. Clients should support the SHA-256 hash.
type: object
additionalProperties:
type: string
v:
description: Version of the encrypted attachments protocol.
type: string
enum: ["v2"]
title: EncryptedFile
type: object
required:
- msgtype
- body
- file
- filename
type: object
type:
enum:
- m.room.message
type: string
title: EncryptedFileMessage
type: object