Trait quinn::crypto::Keys[][src]

pub trait Keys: Send {
    type HeaderKeys: HeaderKeys;
    pub fn new_initial(id: &ConnectionId, side: Side) -> Self;
pub fn encrypt(&self, packet: u64, buf: &mut [u8], header_len: usize);
pub fn decrypt(
        &self,
        packet: u64,
        header: &[u8],
        payload: &mut BytesMut
    ) -> Result<(), ()>;
pub fn header_keys(&self) -> Self::HeaderKeys;
pub fn tag_len(&self) -> usize; }

Keys used to protect packet payloads

Associated Types

type HeaderKeys: HeaderKeys[src]

Type used for header protection keys

Loading content...

Required methods

pub fn new_initial(id: &ConnectionId, side: Side) -> Self[src]

Create the initial set of keys given the initial ConnectionId

pub fn encrypt(&self, packet: u64, buf: &mut [u8], header_len: usize)[src]

Encrypt the packet payload with the given packet number

pub fn decrypt(
    &self,
    packet: u64,
    header: &[u8],
    payload: &mut BytesMut
) -> Result<(), ()>
[src]

Decrypt the packet payload with the given packet number

pub fn header_keys(&self) -> Self::HeaderKeys[src]

Derive the header protection keys from these packet protection keys

pub fn tag_len(&self) -> usize[src]

The length of the AEAD tag appended to packets on encryption

Loading content...

Implementors

Loading content...