Skip to main content

SignedDescriptor

Trait SignedDescriptor 

Source
pub trait SignedDescriptor: Sized {
    type Body: SignedDescriptorBody<Descriptor = Self>;

Show 16 methods // Required methods fn descriptor_did(&self) -> Did; fn descriptor_public_key(&self) -> &VerificationPublicKey; fn descriptor_network_id(&self) -> u32; fn descriptor_signature(&self) -> &MessageVerification; fn descriptor_heartbeat_at_ms(&self) -> u128; fn descriptor_expires_at_ms(&self) -> u128; fn descriptor_fresh_for_ms(&self) -> u64; fn descriptor_signing_data(&self) -> Result<Vec<u8>>; fn heard_at(self, heartbeat_at_ms: u128) -> Self; // Provided methods fn descriptor_verify_signature(&self, network_id: u32) -> bool { ... } fn descriptor_verify_signature_at( &self, network_id: u32, at_ms: u128, ) -> bool { ... } fn descriptor_live_until_ms(&self) -> u128 { ... } fn descriptor_is_expired_at(&self, now_ms: u128) -> bool { ... } fn descriptor_terms_admissible_at(&self, now_ms: u128) -> bool { ... } fn descriptor_is_live_at(&self, now_ms: u128, network_id: u32) -> bool { ... } fn supersedes(&self, other: &Self) -> bool { ... }
}
Expand description

A published descriptor: its body plus the signature over it.

Required Associated Types§

Source

type Body: SignedDescriptorBody<Descriptor = Self>

The body this descriptor was signed from; fixes the message family.

Required Methods§

Source

fn descriptor_did(&self) -> Did

Return the signer’s account DID stated in the descriptor.

Source

fn descriptor_public_key(&self) -> &VerificationPublicKey

Return the signer’s account verification public key stated in the descriptor.

Source

fn descriptor_network_id(&self) -> u32

The overlay the body states.

Source

fn descriptor_signature(&self) -> &MessageVerification

Return the signature envelope attached to this descriptor.

Source

fn descriptor_heartbeat_at_ms(&self) -> u128

When a reader last heard this descriptor, τ*: unsigned (see the lease law).

Source

fn descriptor_expires_at_ms(&self) -> u128

The signed lease end ℓ.

Source

fn descriptor_fresh_for_ms(&self) -> u64

The signed freshness window T.

Source

fn descriptor_signing_data(&self) -> Result<Vec<u8>>

Canonical byte serialization covered by the descriptor signature.

Source

fn heard_at(self, heartbeat_at_ms: u128) -> Self

This descriptor as heard at heartbeat_at_ms, its element’s dot: the one unsigned field.

Provided Methods§

Source

fn descriptor_verify_signature(&self, network_id: u32) -> bool

Verify the signature under the receiver’s overlay network_id, the DID/public-key binding of the signer, and that the body states that same overlay, so a verified descriptor’s stated overlay is the overlay it was signed for.

Source

fn descriptor_verify_signature_at(&self, network_id: u32, at_ms: u128) -> bool

Verify the descriptor’s signature, stated overlay, and delegation liveness at at_ms.

Source

fn descriptor_live_until_ms(&self) -> u128

The last instant a reader holds this descriptor live: min(ℓ, τ* + T + σ).

Source

fn descriptor_is_expired_at(&self, now_ms: u128) -> bool

Whether this descriptor is no longer live at now_ms: its lease ended, or it was not heard within its freshness window and the skew tolerance.

Source

fn descriptor_terms_admissible_at(&self, now_ms: u128) -> bool

Whether the signed lease terms are within the reader’s bounds at now_ms: the lease ends at most Λ + σ from now and the freshness window is at most Λ. A longer lease or window is the signer’s choice, not a registry’s, so it is never live.

Source

fn descriptor_is_live_at(&self, now_ms: u128, network_id: u32) -> bool

Whether a reader at now_ms in overlay network_id lists this descriptor: it verifies, its terms are admissible, and it is not expired (the lease law).

Source

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

Return whether this descriptor supersedes other of the same key: the later lease wins, then the later heartbeat, and a tie is decided by (signed body, signature), so the order is total on distinct descriptors. The lease leads because it is signed: a replayed older lease can be heard later than the current one, but never outranks it. A descriptor whose content fails to encode never supersedes, and is superseded by one that encodes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§