PreKeyFormat

Shape of the public prekey material KSecureMessage publishes. Lets code outside the protocol engine (the server, transports) check untrusted publications without Kodium. This is a format check only: it does not verify the signed prekey signature, which initiators do before X3DH.

Properties

Link copied to clipboard

Most one-time prekeys a single publication may carry.

Link copied to clipboard
const val PUBLIC_KEY_SIZE: Int

Size of an encoded public key: X25519 key followed by Ed25519 key.

Link copied to clipboard
const val SIGNATURE_SIZE: Int = 64

Size of the identity key's detached Ed25519 signature over a signed prekey.

Functions

Link copied to clipboard
fun validate(publication: PreKeyPublication)

Throws IllegalArgumentException if publication has a key or signature of the wrong size, repeats a one-time prekey ID or carries too many one-time prekeys. Messages never contain key bytes.