use crate::prelude::PreSharedKey;
use crate::proto::state_subcontainers::preconnect_state_container::UdpChannelSender;
use citadel_crypt::ratchets::Ratchet;
use citadel_types::proto::SessionSecuritySettings;
pub struct PeerKemStateContainer<R: Ratchet> {
pub(crate) constructor: Option<R::Constructor>,
pub(crate) local_is_initiator: bool,
pub(crate) session_security_settings: SessionSecuritySettings,
pub(crate) udp_channel_sender: UdpChannelSender<R>,
pub(crate) session_password: PreSharedKey,
}
impl<R: Ratchet> PeerKemStateContainer<R> {
pub fn new(
session_security_settings: SessionSecuritySettings,
udp_enabled: bool,
session_password: PreSharedKey,
) -> Self {
Self {
constructor: None,
session_password,
local_is_initiator: false,
session_security_settings,
udp_channel_sender: if udp_enabled {
UdpChannelSender::default()
} else {
UdpChannelSender::empty()
},
}
}
}