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§
Sourcetype Body: SignedDescriptorBody<Descriptor = Self>
type Body: SignedDescriptorBody<Descriptor = Self>
The body this descriptor was signed from; fixes the message family.
Required Methods§
Sourcefn descriptor_did(&self) -> Did
fn descriptor_did(&self) -> Did
Return the signer’s account DID stated in the descriptor.
Sourcefn descriptor_public_key(&self) -> &VerificationPublicKey
fn descriptor_public_key(&self) -> &VerificationPublicKey
Return the signer’s account verification public key stated in the descriptor.
Sourcefn descriptor_network_id(&self) -> u32
fn descriptor_network_id(&self) -> u32
The overlay the body states.
Sourcefn descriptor_signature(&self) -> &MessageVerification
fn descriptor_signature(&self) -> &MessageVerification
Return the signature envelope attached to this descriptor.
Sourcefn descriptor_heartbeat_at_ms(&self) -> u128
fn descriptor_heartbeat_at_ms(&self) -> u128
When a reader last heard this descriptor, τ*: unsigned (see the lease law).
Sourcefn descriptor_expires_at_ms(&self) -> u128
fn descriptor_expires_at_ms(&self) -> u128
The signed lease end ℓ.
Sourcefn descriptor_fresh_for_ms(&self) -> u64
fn descriptor_fresh_for_ms(&self) -> u64
The signed freshness window T.
Sourcefn descriptor_signing_data(&self) -> Result<Vec<u8>>
fn descriptor_signing_data(&self) -> Result<Vec<u8>>
Canonical byte serialization covered by the descriptor signature.
Provided Methods§
Sourcefn descriptor_verify_signature(&self, network_id: u32) -> bool
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.
Sourcefn descriptor_verify_signature_at(&self, network_id: u32, at_ms: u128) -> bool
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.
Sourcefn descriptor_live_until_ms(&self) -> u128
fn descriptor_live_until_ms(&self) -> u128
The last instant a reader holds this descriptor live: min(ℓ, τ* + T + σ).
Sourcefn descriptor_is_expired_at(&self, now_ms: u128) -> bool
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.
Sourcefn descriptor_terms_admissible_at(&self, now_ms: u128) -> bool
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.
Sourcefn descriptor_is_live_at(&self, now_ms: u128, network_id: u32) -> bool
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).
Sourcefn supersedes(&self, other: &Self) -> bool
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".