pub struct KeySet<K> { /* private fields */ }Implementations§
Source§impl<K: OneRttKey> KeySet<K>
impl<K: OneRttKey> KeySet<K>
pub fn new(crypto: K, limits: Limits) -> Self
Sourcepub fn set_derivation_timer(&mut self, timestamp: Timestamp)
pub fn set_derivation_timer(&mut self, timestamp: Timestamp)
Set the timer to derive a new key after timestamp
Sourcepub fn key_update_in_progress(&self) -> bool
pub fn key_update_in_progress(&self) -> bool
Returns whether there is a key update in progress.
Sourcepub fn decrypt_packet<'a>(
&mut self,
packet: EncryptedShort<'a>,
largest_acknowledged_packet_number: PacketNumber,
pto: Timestamp,
) -> Result<(CleartextShort<'a>, Option<u16>), ProcessingError>
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.
Sourcepub fn encryption_phase(&self) -> KeyPhase
pub fn encryption_phase(&self) -> KeyPhase
This is the KeyPhase that should be used to encrypt a given packet.
pub fn encrypt_packet<'a, F>(
&mut self,
buffer: EncoderBuffer<'a>,
f: F,
) -> Result<(ProtectedPayload<'a>, EncoderBuffer<'a>), PacketEncodingError<'a>>where
F: FnOnce(EncoderBuffer<'a>, &mut K, KeyPhase) -> Result<(ProtectedPayload<'a>, EncoderBuffer<'a>), PacketEncodingError<'a>>,
pub fn on_timeout(&mut self, timestamp: Timestamp)
pub fn key_phase(&self) -> KeyPhase
pub fn active_key(&self) -> &Key<K>
pub fn active_key_mut(&mut self) -> &mut Key<K>
pub fn cipher_suite(&mut self) -> CipherSuite
Trait Implementations§
Source§impl<K> Provider for KeySet<K>
impl<K> Provider for KeySet<K>
Source§fn timers<Q: Query>(&self, query: &mut Q) -> Result
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>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next
Timestamp at which the earliest timer is armed in the providerSource§fn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more