pub trait QuicExt {
    // Required methods
    fn quic_transport_parameters(&self) -> Option<&[u8]>;
    fn zero_rtt_keys(&self) -> Option<DirectionalKeys>;
    fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>;
    fn write_hs(&mut self, buf: &mut Vec<u8, Global>) -> Option<KeyChange>;
    fn alert(&self) -> Option<AlertDescription>;
}
Expand description

Generic methods for QUIC sessions

Required Methods§

fn quic_transport_parameters(&self) -> Option<&[u8]>

Return the TLS-encoded transport parameters for the session’s peer.

While the transport parameters are technically available prior to the completion of the handshake, they cannot be fully trusted until the handshake completes, and reliance on them should be minimized. However, any tampering with the parameters will cause the handshake to fail.

fn zero_rtt_keys(&self) -> Option<DirectionalKeys>

Compute the keys for encrypting/decrypting 0-RTT packets, if available

fn read_hs(&mut self, plaintext: &[u8]) -> Result<(), Error>

Consume unencrypted TLS handshake data.

Handshake data obtained from separate encryption levels should be supplied in separate calls.

fn write_hs(&mut self, buf: &mut Vec<u8, Global>) -> Option<KeyChange>

Emit unencrypted TLS handshake data.

When this returns Some(_), the new keys must be used for future handshake data.

fn alert(&self) -> Option<AlertDescription>

Emit the TLS description code of a fatal alert, if one has arisen.

Check after read_hs returns Err(_).

Implementors§