pub struct TrustedKeyRing { /* private fields */ }Expand description
Collection of trusted Ed25519 signing keys.
The package manager iterates over these keys when verifying a package signature, accepting the first key whose Ed25519 verification succeeds.
Implementations§
Source§impl TrustedKeyRing
impl TrustedKeyRing
Sourcepub fn with_builtin_keys() -> Self
pub fn with_builtin_keys() -> Self
Create a key ring pre-populated with the built-in test key.
The built-in key is a deterministic test key for development. Production builds MUST replace this with keys from a real key ceremony.
Sourcepub fn add_key(&mut self, key: TrustedKey)
pub fn add_key(&mut self, key: TrustedKey)
Add a trusted key to the ring.
Sourcepub fn find_key(&self, public_key: &[u8; 32]) -> Option<&TrustedKey>
pub fn find_key(&self, public_key: &[u8; 32]) -> Option<&TrustedKey>
Find the first key whose public key bytes match.
Sourcepub fn find_by_fingerprint(&self, fingerprint: &[u8; 32]) -> Option<&TrustedKey>
pub fn find_by_fingerprint(&self, fingerprint: &[u8; 32]) -> Option<&TrustedKey>
Find a key by its SHA-256 fingerprint.
Sourcepub fn remove_key(&mut self, fingerprint: &[u8; 32])
pub fn remove_key(&mut self, fingerprint: &[u8; 32])
Remove keys matching the given fingerprint.
Sourcepub fn keys(&self) -> &[TrustedKey]
pub fn keys(&self) -> &[TrustedKey]
Iterate over all trusted keys.
Trait Implementations§
Source§impl Clone for TrustedKeyRing
impl Clone for TrustedKeyRing
Source§fn clone(&self) -> TrustedKeyRing
fn clone(&self) -> TrustedKeyRing
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrustedKeyRing
impl Debug for TrustedKeyRing
Auto Trait Implementations§
impl Freeze for TrustedKeyRing
impl RefUnwindSafe for TrustedKeyRing
impl Send for TrustedKeyRing
impl Sync for TrustedKeyRing
impl Unpin for TrustedKeyRing
impl UnwindSafe for TrustedKeyRing
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)