pub struct KeyRing { /* private fields */ }Expand description
Public keys, by the identity the evidence names.
The smallest thing that resolves a SigningKeyId to a PublicKey, and
deliberately no more: whether keys arrive from a config file, a KMS, or a
transparency log is a deployment question, and this type is what all three
end up producing.
Implementations§
Source§impl KeyRing
impl KeyRing
Sourcepub fn with(self, id: impl Into<String>, key: PublicKey) -> Self
pub fn with(self, id: impl Into<String>, key: PublicKey) -> Self
Trust key under the identity id.
Sourcepub fn trusting(self, key: &LocalKey) -> Self
pub fn trusting(self, key: &LocalKey) -> Self
Trust the public half of a local key under its own identity.
Sourcepub fn get(&self, id: &SigningKeyId) -> Option<&PublicKey>
pub fn get(&self, id: &SigningKeyId) -> Option<&PublicKey>
The public key for an identity, if the ring holds one.
Sourcepub fn verify(&self, evidence: &Evidence) -> Result<(), VerifyError>
pub fn verify(&self, evidence: &Evidence) -> Result<(), VerifyError>
Check evidence against whichever key it names.
§Errors
VerifyError::UnknownKey if the ring does not hold the named key —
distinct from VerifyError::Invalid, because an incomplete key ring
is the auditor’s problem and a bad signature is the evidence’s.
Trait Implementations§
impl Eq for KeyRing
impl StructuralPartialEq for KeyRing
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