Class DecryptedMessage

java.lang.Object
io.github.fherbreteau.vodozemac.megolm.DecryptedMessage

public final class DecryptedMessage extends Object
A message successfully decrypted by an InboundGroupSession.

Contains the decrypted plaintext and the message index, which indicates the ratchet position at which the message was encrypted. The message index can be used to detect replay attacks — each plaintext message should be encrypted with a unique message index per session.

Author:
François HERBRETEAU
See Also:
  • Method Details

    • plaintext

      public byte[] plaintext()
      Returns the decrypted plaintext of the message.
      Returns:
      the plaintext bytes
    • messageIndex

      public int messageIndex()
      Returns the message index, used to detect replay attacks.

      Each plaintext message should be encrypted with a unique message index per session.

      Returns:
      the message index
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object