Skip to main content

InitialServerConfig

Trait InitialServerConfig 

pub trait InitialServerConfig: Send + Sync {
    // Required methods
    fn initial_keys(
        &self,
        version: Version,
        dst_cid: &ConnectionId,
    ) -> Result<Keys, InitialKeysError>;
    fn retry_tag(
        &self,
        version: Version,
        orig_dst_cid: &ConnectionId,
        packet: &[u8],
    ) -> Result<[u8; 16], CryptoError>;
}
Available on crate features quic and std only.
Expand description

What a server needs before any session starts: the keys of a client’s Initial packets and the integrity tags of Retry packets.

Required Methods§

fn initial_keys( &self, version: Version, dst_cid: &ConnectionId, ) -> Result<Keys, InitialKeysError>

Create the initial set of keys given the client’s initial destination ConnectionId

fn retry_tag( &self, version: Version, orig_dst_cid: &ConnectionId, packet: &[u8], ) -> Result<[u8; 16], CryptoError>

Generate the integrity tag for a retry packet

Never called if initial_keys rejected version.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§