Skip to main content

GroupKeySet

Struct GroupKeySet 

Source
pub struct GroupKeySet {
    pub fabric_index: FabricIndex,
    pub id: KeySetId,
    pub policy: GroupKeySecurityPolicy,
    pub epoch_keys: Vec<EpochKey, MAX_EPOCH_KEYS>,
}
Available on crate feature rustcrypto only.
Expand description

A group key set: up to three epoch keys in rotation, and the policy that governs them (§4.17.2.2, §11.2.5.4).

Fields§

§fabric_index: FabricIndex

Which fabric it belongs to. Key material is per fabric: §4.17.2.1, “with the exception of the group security info, all input key material SHALL be maintained on a per-Fabric basis”.

§id: KeySetId

Its id, unique within the fabric.

§policy: GroupKeySecurityPolicy

How a receiver decides a message under this key is fresh.

§epoch_keys: Vec<EpochKey, MAX_EPOCH_KEYS>

The epoch keys, oldest first — §4.17.3.2: “An epoch key update SHALL order the keys from oldest to newest.”

Implementations§

Source§

impl GroupKeySet

Source

pub fn single( fabric_index: FabricIndex, id: KeySetId, policy: GroupKeySecurityPolicy, key: SymmetricKey, start_time_us: u64, ) -> Self

A key set holding one epoch key, which is what §11.27.7.1’s JoinGroup and §11.18.6.8’s AddNOC both synthesise.

Rotation needs two or three; a group that has just been created has one, and building it is otherwise four lines of heapless::Vec at every call site.

Source

pub fn current(&self, now: Option<u64>) -> Option<&EpochKey>

The epoch key a sender uses: §4.17.3.1’s “the epoch key with the latest start time that is not in the future”.

now is UTC microseconds, or None on a node without a synchronised clock — which §4.17.3.4 provides for: “such a Node can note which of the keys is the current epoch key by comparing their relative start times and using the current epoch key which has the second newest time.” With fewer than two enabled keys that degrades to the newest, which is the only one it could mean.

Trait Implementations§

Source§

impl Clone for GroupKeySet

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GroupKeySet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for GroupKeySet

Source§

impl PartialEq for GroupKeySet

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GroupKeySet

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.