models/secure_message library

SecureMessage – Wire model for headers/body

Represents the protocol wire format used over (or alongside) HTTP: Headers (as key-value strings): "version": 1 // protocol version "window":

This type offers:

  • Construction from raw bytes (fromParts)
  • Parsing from wire headers/body (fromWire)
  • Serialization back to wire headers/body (toWireHeaders, toWireBody)

SECURITY NOTES:

  • This type does not verify MACs nor decrypt. It only parses/holds data.
  • Validation here is strictly for format (presence, base64, lengths).
  • Keep field names exactly "version","window","nonce","ciphertext" to match the protocol.

HINTS:

  • Use with Encryptor (to build a SecureMessage) and Decryptor (to parse).
  • Headers are returned as Map<String,String> ready to be attached to an HTTP request by a higher-level client (this library does not send HTTP).

Classes

SecureMessage