Class OlmMessage
MessageType and a
base64-encoded ciphertext body.
An OlmMessage is produced by OlmSession.encrypt(byte[]) and
consumed by OlmSession.decrypt(OlmMessage) and
Account.createInboundSession(io.github.fherbreteau.vodozemac.types.Curve25519PublicKey, OlmMessage).
The message will either be a pre-key message or
a normal message, depending on whether the session
is fully established. A session is fully established once at least one
message has been received and decrypted from the other side.
The toString() method produces a JSON representation compatible with
the Matrix Olm message format ({"body":"<base64>","type":<int>}),
which is what the native vodozemac layer expects for serialisation and
deserialisation.
- Author:
- François HERBRETEAU
- See Also:
-
Method Details
-
body
Returns the base64-encoded ciphertext body of this message.- Returns:
- the ciphertext body as a base64 string
-
type
Returns the type of this message.- Returns:
- the
MessageType(pre-key or normal)
-
equals
-
hashCode
-
toJson
Returns the JSON representation of this message, in the format{"body":"<base64>","type":<int>}.This format is compatible with the Matrix Olm message serialisation used by the native vodozemac layer.
- Returns:
- a JSON string representation of this message
-
toString
-