Struct KeySet

Source
pub struct KeySet<K> { /* private fields */ }

Implementations§

Source§

impl<K: OneRttKey> KeySet<K>

Source

pub fn new(crypto: K, limits: Limits) -> Self

Source

pub fn set_derivation_timer(&mut self, timestamp: Timestamp)

Set the timer to derive a new key after timestamp

Source

pub fn key_update_in_progress(&self) -> bool

Returns whether there is a key update in progress.

Source

pub fn decrypt_packet<'a>( &mut self, packet: EncryptedShort<'a>, largest_acknowledged_packet_number: PacketNumber, pto: Timestamp, ) -> Result<(CleartextShort<'a>, Option<u16>), ProcessingError>

Passes the key for the the requested phase to a callback function. Integrity limits are enforced.

Returns the decrypted packet and generation if the key phase was rotated.

Source

pub fn encryption_phase(&self) -> KeyPhase

This is the KeyPhase that should be used to encrypt a given packet.

Source

pub fn encrypt_packet<'a, F>( &mut self, buffer: EncoderBuffer<'a>, f: F, ) -> Result<(ProtectedPayload<'a>, EncoderBuffer<'a>), PacketEncodingError<'a>>

Source

pub fn on_timeout(&mut self, timestamp: Timestamp)

Source

pub fn key_phase(&self) -> KeyPhase

Source

pub fn active_key(&self) -> &Key<K>

Source

pub fn active_key_mut(&mut self) -> &mut Key<K>

Source

pub fn cipher_suite(&mut self) -> CipherSuite

Trait Implementations§

Source§

impl<K> Provider for KeySet<K>

Source§

fn timers<Q: Query>(&self, query: &mut Q) -> Result

Notifies the query of any timers owned by the provider Read more
Source§

fn next_expiration(&self) -> Option<Timestamp>

Returns the next Timestamp at which the earliest timer is armed in the provider
Source§

fn is_armed(&self) -> bool

Returns true if there are any timers armed
Source§

fn armed_timer_count(&self) -> usize

Counts the number of armed timers in the provider
Source§

fn for_each_timer<F: FnMut(&Timer) -> Result>(&self, f: F)

Iterates over each timer in the provider and calls the provided function

Auto Trait Implementations§

§

impl<K> Freeze for KeySet<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for KeySet<K>
where K: RefUnwindSafe,

§

impl<K> Send for KeySet<K>
where K: Send,

§

impl<K> Sync for KeySet<K>
where K: Sync,

§

impl<K> Unpin for KeySet<K>
where K: Unpin,

§

impl<K> UnwindSafe for KeySet<K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

Source§

fn upcast(self) -> T

Source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

Source§

fn upcast_from(value: Counter<T, B>) -> T