Struct s2n_quic_core::crypto::application::KeySet
source · [−]pub struct KeySet<K> { /* private fields */ }Implementations
sourceimpl<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>, &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(&self) -> CipherSuite
Trait Implementations
sourceimpl<K> Provider for KeySet<K>
impl<K> Provider for KeySet<K>
sourcefn 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
sourcefn next_expiration(&self) -> Option<Timestamp>
fn next_expiration(&self) -> Option<Timestamp>
Returns the next Timestamp at which the earliest timer is armed in the provider
sourcefn armed_timer_count(&self) -> usize
fn armed_timer_count(&self) -> usize
Counts the number of armed timers in the provider
sourcefn for_each_timer<F: FnMut(&Timer) -> Result>(&self, f: F)
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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more