pub struct Keyring { /* private fields */ }Expand description
Verification keyring: key id → public key. Old receipts stay verifiable after rotation as long as their key remains in the ring.
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub fn add_key_bytes(&mut self, bytes: &[u8; 32]) -> Result<String, KeyError>
pub fn add_key_bytes(&mut self, bytes: &[u8; 32]) -> Result<String, KeyError>
Add a key by raw public bytes; returns its derived key id.
If the derived id already exists with a different public key, refuses
silently overwriting it and returns KeyMismatch — otherwise an
attacker who found a 128-bit collision could substitute their key for
an honest signer’s.
Sourcepub fn add_signer(&mut self, signer: &dyn Signer) -> Result<String, KeyError>
pub fn add_signer(&mut self, signer: &dyn Signer) -> Result<String, KeyError>
Add the public half of a signer.
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