Struct openmls::key_packages::Lifetime
source · 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.
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 more