Trait quinn::crypto::Session [−][src]
A cryptographic session (commonly TLS)
Associated Types
type ClientConfig: ClientConfig<Self>
[src]
Type used to hold configuration for client sessions
type HmacKey: HmacKey
[src]
Type used to sign various values
type Keys: Keys + Sized
[src]
Type used to represent packet protection keys
type ServerConfig: ServerConfig<Self>
[src]
Type used to hold configuration for server sessions
Required methods
pub fn alpn_protocol(&self) -> Option<&[u8]>
[src]
Get the negotiated ALPN protocol
Returns None
if the handshake has not advanced sufficiently or if no ALPN protocol
has been negotiated.
pub fn early_crypto(&self) -> Option<Self::Keys>
[src]
Get the 0-RTT keys if available (clients only)
On the client side, this method can be used to see if 0-RTT key material is available to start sending data before the protocol handshake has completed.
Returns None
if the key material is not available. This might happen if you have
not connected to this server before.
pub fn early_data_accepted(&self) -> Option<bool>
[src]
If the 0-RTT-encrypted data has been accepted by the peer
pub fn is_handshaking(&self) -> bool
[src]
Returns true
until the connection is fully established.
pub fn read_handshake(&mut self, buf: &[u8]) -> Result<(), Error>
[src]
Read bytes of handshake data
This should be called with the contents of CRYPTO
frames. If it returns Ok
, the
caller should call write_handshake()
to check if the crypto protocol has anything
to send to the peer.
pub fn sni_hostname(&self) -> Option<&str>
[src]
The SNI hostname sent by the client (server only)
pub fn transport_parameters(&self) -> Result<Option<TransportParameters>, Error>
[src]
The peer’s QUIC transport parameters
These are only available after the first flight from the peer has been received.
pub fn write_handshake(
&mut self,
buf: &mut Vec<u8, Global>
) -> Option<Self::Keys>
[src]
&mut self,
buf: &mut Vec<u8, Global>
) -> Option<Self::Keys>
Writes handshake bytes into the given buffer and optionally returns the negotiated keys
When the handshake proceeds to the next phase, this method will return a new set of keys to encrypt data with.
pub fn update_keys(&self, keys: &Self::Keys) -> Self::Keys
[src]
Update the given set of keys