pub struct GroupKeySet {
pub fabric_index: FabricIndex,
pub id: KeySetId,
pub policy: GroupKeySecurityPolicy,
pub epoch_keys: Vec<EpochKey, MAX_EPOCH_KEYS>,
}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: FabricIndexWhich 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: KeySetIdIts id, unique within the fabric.
policy: GroupKeySecurityPolicyHow 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
impl GroupKeySet
Sourcepub fn single(
fabric_index: FabricIndex,
id: KeySetId,
policy: GroupKeySecurityPolicy,
key: SymmetricKey,
start_time_us: u64,
) -> Self
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.
Sourcepub fn current(&self, now: Option<u64>) -> Option<&EpochKey>
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.