Module: message

class omemo.message.Content[source]

Bases: ABC

The encrypted content of an OMEMO-encrypted message. Contains for example the ciphertext, but can contain other backend-specific data that is shared between all recipients.

abstract property empty: bool

Returns: Whether this instance corresponds to an empty OMEMO message purely used for protocol stability reasons.

Return type

bool

class omemo.message.EncryptedKeyMaterial[source]

Bases: ABC

Encrypted key material. When decrypted, the key material can in turn be used to decrypt the content. One collection of key material is included in an OMEMO-encrypted message per recipient. Defails are backend-specific.

abstract property bare_jid: str
Return type

str

abstract property device_id: int
Return type

int

class omemo.message.KeyExchange[source]

Bases: ABC

Key exchange information, generated by the active part of the session building process, then transferred to and consumed by the passive part of the session building process. Details are backend-specific.

abstract property identity_key: bytes
Return type

bytes

abstract builds_same_session(other)[source]
Parameters

other (KeyExchange) – The other key exchange instance to compare to this instance.

Return type

bool

Returns

Whether the key exchange information stored in this instance and the key exchange information stored in the other instance would build the same session.

class omemo.message.Message(namespace, bare_jid, device_id, content, keys)[source]

Bases: tuple

Simple structure representing an OMEMO-encrypted message.

Parameters
property namespace

Alias for field number 0

property bare_jid

Alias for field number 1

property device_id

Alias for field number 2

property content

Alias for field number 3

property keys

Alias for field number 4

class omemo.message.PlainKeyMaterial[source]

Bases: ABC

Key material which be used to decrypt the content. Defails are backend-specific.