Class PkMessage
java.lang.Object
io.github.fherbreteau.vodozemac.backup.PkMessage
A message that was encrypted using a
PkEncryption object.
A PkMessage consists of three base64-encoded components:
- The ciphertext, produced by AES-CBC encryption of the plaintext
- The MAC (message authentication code), intended to authenticate the message
- The ephemeral Curve25519 public key used to derive the message key via X25519 ECDH
Warning: As stated in the PkEncryption class
documentation, the MAC does not authenticate the ciphertext.
The MAC is computed over an empty message rather than the actual
ciphertext, meaning tampering with the ciphertext will not be detected.
- Author:
- François HERBRETEAU
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the base64-encoded ciphertext of the message.Returns the base64-encoded ephemeral Curve25519 public key used to derive the message key for this message.booleaninthashCode()mac()Returns the base64-encoded MAC (message authentication code) of the message.toString()
-
Method Details
-
ciphertext
Returns the base64-encoded ciphertext of the message.- Returns:
- the ciphertext as a base64 string
-
mac
Returns the base64-encoded MAC (message authentication code) of the message.Warning: The MAC does not authenticate the ciphertext. See the
PkEncryptionclass documentation for details.- Returns:
- the MAC as a base64 string
-
ephemeralKey
Returns the base64-encoded ephemeral Curve25519 public key used to derive the message key for this message.- Returns:
- the ephemeral key as a base64 string
-
equals
-
hashCode
-
toString
-