pub struct PacketKey { /* private fields */ }
Available on crate feature quic only.
Expand description

Keys to encrypt or decrypt the payload of a packet

Implementations

Encrypt a QUIC packet

Takes a packet_number, used to derive the nonce; the packet header, which is used as the additional authenticated data; and the payload. The authentication tag is returned if encryption succeeds.

Fails iff the payload is longer than allowed by the cipher suite’s AEAD algorithm.

Decrypt a QUIC packet

Takes the packet header, which is used as the additional authenticated data, and the payload, which includes the authentication tag.

If the return value is Ok, the decrypted payload can be found in payload, up to the length found in the return value.

Number of times the packet key can be used without sacrificing confidentiality

See https://www.rfc-editor.org/rfc/rfc9001.html#name-confidentiality-limit.

Number of times the packet key can be used without sacrificing integrity

See https://www.rfc-editor.org/rfc/rfc9001.html#name-integrity-limit.

Tag length for the underlying AEAD algorithm

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.