pub struct KeyRing { /* private fields */ }Expand description
The public keys an agent trusts, keyed by kid.
Implementations§
Source§impl KeyRing
impl KeyRing
pub fn new() -> Self
pub fn insert( &mut self, kid: impl Into<String>, key: VerifyingKey, policy: KeyPolicy, )
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, kid: &str) -> Option<(&str, &VerifyingKey, &KeyPolicy)>
pub fn get(&self, kid: &str) -> Option<(&str, &VerifyingKey, &KeyPolicy)>
Look a key up, yielding the ring’s own kid string so a verified
result borrows from the trusted ring rather than from the attacker-
supplied header it was matched against.
Sourcepub fn kids(&self) -> impl Iterator<Item = &str>
pub fn kids(&self) -> impl Iterator<Item = &str>
Every kid on the ring, for reporting which keys an agent holds.
Sourcepub fn kid_fingerprints(&self) -> impl Iterator<Item = String>
pub fn kid_fingerprints(&self) -> impl Iterator<Item = String>
Every entry as kid:fingerprint, which is what the heartbeat reports.
The kid alone cannot answer “do two machines holding the same id hold
the same key” (#1229). A ring entry with the right id and wrong bytes
refuses every command once enforcement is on, and does not self-heal —
the reload-on-unknown-key path never fires, because the key is
present, just wrong. Carrying the fingerprint makes that state visible
from the fleet view instead of only on the host.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyRing
impl RefUnwindSafe for KeyRing
impl Send for KeyRing
impl Sync for KeyRing
impl Unpin for KeyRing
impl UnsafeUnpin for KeyRing
impl UnwindSafe for KeyRing
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
Mutably borrows from an owned value. Read more