pub struct Root {
pub version: u32,
pub org: String,
pub keys: Vec<PublicKey>,
pub threshold: u8,
pub release: Vec<Delegation>,
pub release_threshold: u8,
pub timestamp: Vec<PublicKey>,
pub timestamp_threshold: u8,
pub expires: Option<Timestamp>,
}Expand description
An org root record.
Fields§
§version: u32Starts at 1 and goes up by exactly 1 per rotation.
org: StringThe org’s id on the service.
keys: Vec<PublicKey>Root keys (held offline by the org, never by the service).
threshold: u8Root signatures needed.
release: Vec<Delegation>Delegated release keys.
release_threshold: u8Release signatures needed on a manifest.
timestamp: Vec<PublicKey>Trusted timestamp keys; empty means the app trusts none (freshness falls back to the manifest’s own expiry and seq order).
timestamp_threshold: u8Timestamp signatures needed; 0 exactly when timestamp is empty.
expires: Option<Timestamp>Optional expiry of this root version.
Implementations§
Source§impl Root
impl Root
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Structural checks: ids, no duplicate keys, thresholds within range, limits.
Sourcepub fn trusts_timestamps(&self) -> bool
pub fn trusts_timestamps(&self) -> bool
Whether the app trusts any timestamp key.
Sourcepub fn release_keys_for(
&self,
app: &str,
channel: &str,
now: Timestamp,
) -> Vec<PublicKey>
pub fn release_keys_for( &self, app: &str, channel: &str, now: Timestamp, ) -> Vec<PublicKey>
Release keys that may sign for app/channel at now.
Sourcepub fn verify_initial(
pin: &RootPin,
env: &Signed,
now: Timestamp,
) -> Result<Self>
pub fn verify_initial( pin: &RootPin, env: &Signed, now: Timestamp, ) -> Result<Self>
Verifies the first root against the pin compiled into the app: its keys must hash to the pin and a threshold of them must have signed it.
Sourcepub fn verify_next(&self, env: &Signed, now: Timestamp) -> Result<Self>
pub fn verify_next(&self, env: &Signed, now: Timestamp) -> Result<Self>
Verifies a rotation from self to the next version.