PreKeyMessage
@Serializable
A ratchet message plus the X3DH data the recipient needs to create its side of the session.
The initiator sends every message as a PreKeyMessage until it has decrypted the first reply. So the recipient can still set up the session if earlier messages were lost or arrive out of order. signedPreKeyId and oneTimePreKeyId tell the recipient which of its private prekeys to use.
initiationVersion is the session initiation format (docs/session-lifecycle.md). New initiations are always SessionInitiationVersion.V2, which authenticates every header field and both device addresses. A SessionInitiationVersion.V1 message only continues a session that exists already; it never creates, replaces or wins anything (S1).
Constructors
Link copied to clipboard
constructor(identityKey: ByteArray, ephemeralKey: ByteArray, signedPreKeyId: SignedPreKeyId, oneTimePreKeyId: OneTimePreKeyId?, message: RatchetMessage, initiationVersion: SessionInitiationVersion = SessionInitiationVersion.V2)