pub struct UpdateVerifier { /* private fields */ }Expand description
Verifies software update packages before installation.
Register one or more trusted publisher keys with register_publisher,
then call verify for each candidate update. Failed
verifications are automatically recorded in a supplied UpdateVerificationLog.
Implementations§
Source§impl UpdateVerifier
impl UpdateVerifier
Sourcepub fn register_publisher(&mut self, publisher_id: &str, key: VerifyingKey)
pub fn register_publisher(&mut self, publisher_id: &str, key: VerifyingKey)
Register a trusted publisher key.
Only updates signed by a registered publisher will pass verification.
Sourcepub fn verify(
&self,
update: &SoftwareUpdate,
payload: &[u8],
publisher_id: &str,
log: &mut UpdateVerificationLog,
) -> Result<(), UpdateVerifyError>
pub fn verify( &self, update: &SoftwareUpdate, payload: &[u8], publisher_id: &str, log: &mut UpdateVerificationLog, ) -> Result<(), UpdateVerifyError>
Verify update against payload and record the outcome in log.
Returns Ok(()) only when:
publisher_idis registered,BLAKE3(payload) == update.payload_hash, and- the Ed25519 signature is valid.
Any failure appends a UpdateVerifyDecision::Rejected entry to log
and returns the corresponding UpdateVerifyError.
Trait Implementations§
Source§impl Debug for UpdateVerifier
impl Debug for UpdateVerifier
Source§impl Default for UpdateVerifier
impl Default for UpdateVerifier
Source§fn default() -> UpdateVerifier
fn default() -> UpdateVerifier
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UpdateVerifier
impl RefUnwindSafe for UpdateVerifier
impl Send for UpdateVerifier
impl Sync for UpdateVerifier
impl Unpin for UpdateVerifier
impl UnsafeUnpin for UpdateVerifier
impl UnwindSafe for UpdateVerifier
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