pub struct Lifetime { /* private fields */ }
Expand description
The lifetime represents the times between which clients will consider a KeyPackage valid. This time is represented as an absolute time, measured in seconds since the Unix epoch (1970-01-01T00:00:00Z). A client MUST NOT use the data in a KeyPackage for any processing before the not_before date, or after the not_after date.
Applications MUST define a maximum total lifetime that is acceptable for a KeyPackage, and reject any KeyPackage where the total lifetime is longer than this duration.This extension MUST always be present in a KeyPackage.
// draft-ietf-mls-protocol-16
struct {
uint64 not_before;
uint64 not_after;
} Lifetime;
Implementations§
Source§impl Lifetime
impl Lifetime
Sourcepub fn new(t: u64) -> Self
pub fn new(t: u64) -> Self
Create a new lifetime with lifetime t
(in seconds).
Note that the lifetime is extended 1h into the past to adapt to skewed
clocks, i.e. not_before
is set to now - 1h.
Sourcepub fn has_acceptable_range(&self) -> bool
pub fn has_acceptable_range(&self) -> bool
ValSem(openmls/annotations#32): Applications MUST define a maximum total lifetime that is acceptable for a LeafNode, and reject any LeafNode where the total lifetime is longer than this duration.
Sourcepub fn not_before(&self) -> u64
pub fn not_before(&self) -> u64
Returns the “not before” timestamp of the KeyPackage.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lifetime
impl<'de> Deserialize<'de> for Lifetime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Deserialize for Lifetime
impl Deserialize for Lifetime
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
bytes
from the provided a std::io::Read
and returns the populated struct. Read moreSource§impl DeserializeBytes for Lifetime
impl DeserializeBytes for Lifetime
impl Copy for Lifetime
impl Eq for Lifetime
impl StructuralPartialEq for Lifetime
Auto Trait Implementations§
impl Freeze for Lifetime
impl RefUnwindSafe for Lifetime
impl Send for Lifetime
impl Sync for Lifetime
impl Unpin for Lifetime
impl UnwindSafe for Lifetime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more