pub struct PairRequestMessage {
pub sender_kind: i32,
pub mlkem_ciphertext: Vec<u8>,
pub ecies_public_key: Vec<u8>,
pub channel_id: u64,
pub communication_info: Option<CommunicationInfo>,
pub nonce: u64,
pub parameter_range: Option<ParameterRange>,
pub transport_protocol: Option<TransportProtocol>,
pub timestamp: Option<Timestamp>,
}Expand description
PairRequestMessage is the first message in the pairing protocol, sent from the initiator to the responder after receiving a ContactMessage.
§Preconditions
Before sending this message:
- The initiator MUST have received a valid ContactMessage from the responder
- The initiator MUST use the responder’s public encryption material from the ContactMessage to construct this request
§Purpose
This message establishes:
- the initiator’s identity and role (Owner/Helper, recovery mode or not)
- fresh cryptographic material for the responder to use in subsequent messages
- agreement negotiation inputs (parameter ranges)
- binding between the out-of-band contact exchange and this pairing attempt
- transport information for future communication
§Security Properties
- The nonce binds this request to the ContactMessage exchange
- The ciphertext and public keys bootstrap a secure communication channel
- The message is encrypted and authenticated at the DeRecMessage layer
§Outcome
Upon successful processing, the responder replies with PairResponseMessage. After this exchange:
- both parties know each other’s public keys
- a secure communication channel is established for subsequent protocol flows
Fields§
§sender_kind: i32The role of the sender of this message.
This informs the responder whether the initiator is:
- an Owner (normal or recovery mode), or
- a Helper
Recovery mode has special semantics for how Helpers associate this pairing with existing stored secrets.
mlkem_ciphertext: Vec<u8>ML-KEM-768 ciphertext.
This ciphertext is generated using the responder’s ML-KEM public key obtained from the ContactMessage. It is used to establish shared cryptographic material for securing subsequent communication.
ecies_public_key: Vec<u8>Serialized ECIES public key of the sender.
This key is provided to the responder so that future messages can be encrypted toward the initiator.
channel_id: u64Channel identifier chosen by the initiator.
This value identifies the logical communication channel that will be established upon successful pairing. The responder MUST use this value when sending subsequent messages to the initiator.
Implementations SHOULD ensure uniqueness to avoid collisions between concurrent or stored pairing sessions.
communication_info: Option<CommunicationInfo>Sender’s application-level identifying information.
This field is intended for user-facing identification and may include data such as name, phone number, or account identifiers.
It is not used directly by the protocol for security decisions.
nonce: u64Nonce binding this request to the ContactMessage exchange.
This value MUST match the nonce provided in the ContactMessage. It allows the responder to verify that the pairing request corresponds to the same out-of-band interaction, preventing mismatched or spoofed pairing attempts.
parameter_range: Option<ParameterRange>Parameter range supported by the sender.
This defines the acceptable configuration space (e.g., thresholds, limits) that the sender is willing to operate under.
The responder combines this with its own parameter range to determine whether pairing is possible and which parameters to use.
transport_protocol: Option<TransportProtocol>Transport information for reaching the initiator.
This specifies:
- the endpoint where the initiator can receive messages
- the protocol required to deliver those messages
After pairing, the responder uses this information to send responses and all subsequent protocol messages to the initiator.
timestamp: Option<Timestamp>Timestamp indicating when this message was created.
Used for observability and may assist in replay detection or timeout handling, depending on the implementation.
Implementations§
Source§impl PairRequestMessage
impl PairRequestMessage
Sourcepub fn sender_kind(&self) -> SenderKind
pub fn sender_kind(&self) -> SenderKind
Returns the enum value of sender_kind, or the default if the field is set to an invalid enum value.
Sourcepub fn set_sender_kind(&mut self, value: SenderKind)
pub fn set_sender_kind(&mut self, value: SenderKind)
Sets sender_kind to the provided enum value.
Trait Implementations§
Source§impl Clone for PairRequestMessage
impl Clone for PairRequestMessage
Source§fn clone(&self) -> PairRequestMessage
fn clone(&self) -> PairRequestMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PairRequestMessage
impl Debug for PairRequestMessage
Source§impl Default for PairRequestMessage
impl Default for PairRequestMessage
Source§impl Message for PairRequestMessage
impl Message for PairRequestMessage
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.