pub struct ActiveSecuritySetup<'a, T: AsyncRead + Unpin, S: AsyncWrite + Unpin> { /* private fields */ }Expand description
Active part of a Silkroad Online connection handshake.
The active part in a handshake thats the initialization process and will also decide the security features (SecurityFeature) available for the connection. By default, all security features will be made available. Using ActiveSecuritySetup::handle will default to all features, while ActiveSecuritySetup::handle_with_features allows you to pick which features should be enabled, if any.
AsyncSecuritySetup::handle(&mut reader, &mut writer).await
// OR
AsyncSecuritySetup::handle_with_features(&mut reader, &mut writer, SecurityFeature::CHECKS).awaitOnce complete, it will set the skrillax_packet::SecurityContext of the reader & writer with the enabled features. This will then allow, for example, sending and receiving of encrypted packets.
Implementations§
Source§impl<T: AsyncRead + Unpin, S: AsyncWrite + Unpin> ActiveSecuritySetup<'_, T, S>
impl<T: AsyncRead + Unpin, S: AsyncWrite + Unpin> ActiveSecuritySetup<'_, T, S>
Sourcepub async fn handle(
reader: &mut SilkroadStreamRead<T>,
writer: &mut SilkroadStreamWrite<S>,
) -> Result<(), HandshakeError>
pub async fn handle( reader: &mut SilkroadStreamRead<T>, writer: &mut SilkroadStreamWrite<S>, ) -> Result<(), HandshakeError>
Starts and executes the handshake procedures as the active participant with default security features.
Sourcepub async fn handle_with_features(
reader: &mut SilkroadStreamRead<T>,
writer: &mut SilkroadStreamWrite<S>,
enabled_features: SecurityFeature,
) -> Result<(), HandshakeError>
pub async fn handle_with_features( reader: &mut SilkroadStreamRead<T>, writer: &mut SilkroadStreamWrite<S>, enabled_features: SecurityFeature, ) -> Result<(), HandshakeError>
Starts and executes the handshake procedures as the active participant with predefined security features.