Skip to main content

TrustRoot

Struct TrustRoot 

Source
pub struct TrustRoot {
    pub log_public_key: Ed25519PublicKey,
    pub log_origin: LogOrigin,
    pub witnesses: Vec<TrustRootWitness>,
    pub signature_algorithm: SignatureAlgorithm,
    pub ecdsa_log_public_key_der: Option<Vec<u8>>,
    pub independence_policy: IndependencePolicy,
}
Expand description

Trust root for verifying transparency log checkpoints.

Contains the log’s signing public key and an optional witness list. For Epic 1 (fn-72), this is hardcoded in the verifier binary. TUF-based distribution comes in fn-76.

Args:

  • log_public_key — The Ed25519 public key of the log operator.
  • log_origin — The log origin string for checkpoint verification.
  • witnesses — List of trusted witness public keys and names.

Usage:

let trust_root = TrustRoot {
    log_public_key: Ed25519PublicKey::from_bytes(key_bytes),
    log_origin: LogOrigin::new("auths.dev/log")?,
    witnesses: vec![],
};

Fields§

§log_public_key: Ed25519PublicKey

The log operator’s Ed25519 public key. Used only when signature_algorithm == Ed25519. Under the EcdsaP256 path, this field MUST NOT be the trust anchor — see Self::ecdsa_log_public_key_der for that.

§log_origin: LogOrigin

The log origin string (e.g., “auths.dev/log”).

§witnesses: Vec<TrustRootWitness>

Trusted witness keys. Empty for Epic 1.

§signature_algorithm: SignatureAlgorithm

Signature algorithm for checkpoint verification. Defaults to Ed25519. Rekor production shard uses EcdsaP256.

§ecdsa_log_public_key_der: Option<Vec<u8>>

DER-encoded SubjectPublicKeyInfo for the log’s ECDSA-P256 public key. REQUIRED when signature_algorithm == EcdsaP256; the verifier compares the bundle-carried ECDSA pubkey against this pinned value byte-for-byte before using it to verify the checkpoint signature. Without this field, an attacker can submit a bundle with a self-chosen ECDSA key that verifies its own forged signature — a classic “trust the key I sent you” anti-pattern.

§independence_policy: IndependencePolicy

Minimum-diversity thresholds the actual cosigning quorum must clear, layered on top of the n/2+1 count. Defaults to unconstrained (no diversity required) so a legacy trust root that pins no policy keeps its existing behavior; a commons trust root built from a pinned witness_policy.json carries real thresholds and enforces them.

Trait Implementations§

Source§

impl Clone for TrustRoot

Source§

fn clone(&self) -> TrustRoot

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 TrustRoot

Source§

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

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

impl<'de> Deserialize<'de> for TrustRoot

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 Serialize for TrustRoot

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

Auto Trait Implementations§

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.