pub struct Manifest {
pub schema_version: u32,
pub sequence: u64,
pub generated_at: String,
pub expires_at: Option<String>,
pub min_runtime_version: String,
pub components: Vec<ManifestComponent>,
pub signature: Option<String>,
}Expand description
The top-level manifest structure.
Contains metadata (schema version, sequence, timestamps) and a list of component entries.
Fields§
§schema_version: u32§sequence: u64Monotonically increasing sequence number for anti-rollback.
generated_at: StringISO 8601 timestamp of when the manifest was generated.
expires_at: Option<String>ISO 8601 timestamp after which the manifest is considered stale.
None means the manifest never expires.
min_runtime_version: StringMinimum runtime version required to process this manifest.
components: Vec<ManifestComponent>The component entries.
signature: Option<String>HMAC-SHA256 signature over the canonical JSON body (excludes this field).
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn load_baseline() -> Result<Self>
pub fn load_baseline() -> Result<Self>
Load the bundled baseline manifest compiled into the binary.
Sourcepub fn compute_signature(&self) -> String
pub fn compute_signature(&self) -> String
Compute the HMAC-SHA256 signature over the manifest body.
The signature covers all fields except the signature field itself.
We produce a canonical JSON representation without the signature, then
compute HMAC-SHA256.
Sourcepub fn verify_signature(&self) -> Result<(), ManifestTrustError>
pub fn verify_signature(&self) -> Result<(), ManifestTrustError>
Verify the manifest’s signature.
Returns Ok(()) if the signature is present and valid.
Returns Err(ManifestTrustError::SignatureVerificationError) otherwise.
Sourcepub fn verify_schema_version(&self) -> Result<(), ManifestTrustError>
pub fn verify_schema_version(&self) -> Result<(), ManifestTrustError>
Check the schema version against the minimum supported version.
Returns Ok(()) if schema_version >= MIN_SCHEMA_VERSION.
Sourcepub fn verify_expiry(&self) -> Result<(), ManifestTrustError>
pub fn verify_expiry(&self) -> Result<(), ManifestTrustError>
Check the manifest expiry.
Returns Ok(()) if the manifest has no expiry or has not expired.
Returns Err(ManifestTrustError::ManifestExpiredError) if expired.
Sourcepub fn verify_trust(&self) -> Result<(), ManifestTrustError>
pub fn verify_trust(&self) -> Result<(), ManifestTrustError>
Run all trust checks: signature, schema version, and expiry.
Returns the first error encountered, or Ok(()) if all pass.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Manifest
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnsafeUnpin for Manifest
impl UnwindSafe for Manifest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more