Skip to main content

Root

Struct Root 

Source
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: u32

Starts at 1 and goes up by exactly 1 per rotation.

§org: String

The org’s id on the service.

§keys: Vec<PublicKey>

Root keys (held offline by the org, never by the service).

§threshold: u8

Root signatures needed.

§release: Vec<Delegation>

Delegated release keys.

§release_threshold: u8

Release 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: u8

Timestamp signatures needed; 0 exactly when timestamp is empty.

§expires: Option<Timestamp>

Optional expiry of this root version.

Implementations§

Source§

impl Root

Source

pub fn validate(&self) -> Result<()>

Structural checks: ids, no duplicate keys, thresholds within range, limits.

Source

pub fn pin(&self) -> RootPin

The fingerprint of this root’s keys and threshold.

Source

pub fn trusts_timestamps(&self) -> bool

Whether the app trusts any timestamp key.

Source

pub fn release_keys_for( &self, app: &str, channel: &str, now: Timestamp, ) -> Vec<PublicKey>

Release keys that may sign for app/channel at now.

Source

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.

Source

pub fn verify_next(&self, env: &Signed, now: Timestamp) -> Result<Self>

Verifies a rotation from self to the next version.

Trait Implementations§

Source§

impl Clone for Root

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Root

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Root

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Root

Source§

impl PartialEq for Root

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Root

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Root

Auto Trait Implementations§

§

impl Forget for Root

§

impl Freeze for Root

§

impl Move for Root

§

impl RefUnwindSafe for Root

§

impl Send for Root

§

impl Sync for Root

§

impl Unpin for Root

§

impl UnsafeUnpin for Root

§

impl UnwindSafe for Root

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.