Skip to main content

SignedSensingEvidencePolicy

Trait SignedSensingEvidencePolicy 

Source
pub trait SignedSensingEvidencePolicy {
    // Required methods
    fn authorized_source_key(
        &self,
        source_id: u64,
        adapter_id: u64,
        adapter_epoch: u32,
    ) -> Option<VerifyingKey>;
    fn grant_and_decision_valid(
        &self,
        envelope: &SignedSensingEvidence,
        evidence: &SensingEvidence,
        grant_id: &[u8; 32],
        grant_digest: &[u8; 32],
        decision_commitment: &[u8; 32],
        now_unix_seconds: u64,
    ) -> bool;
    fn calibration_commitment_matches(
        &self,
        evidence: &SensingEvidence,
        calibration_reference_id: &[u8; 32],
        calibration_artifact_commitment: &[u8; 32],
    ) -> bool;
    fn payload_digest_matches(
        &self,
        evidence: &SensingEvidence,
        payload_digest: &[u8; 32],
    ) -> bool;
    fn calibration_artifact_verified(
        &self,
        envelope: &SignedSensingEvidence,
        evidence: &SensingEvidence,
        now_unix_seconds: u64,
    ) -> bool;
}
Expand description

Trusted caller policy. Implementations must verify exact grant/decision binding and current revocation state, source-key authorization for this source/adapter/epoch tuple, and calibration reference-to-digest identity. These hooks do not assert that a correctly signed sensor statement is physically true.

Required Methods§

Source

fn authorized_source_key( &self, source_id: u64, adapter_id: u64, adapter_epoch: u32, ) -> Option<VerifyingKey>

Source

fn grant_and_decision_valid( &self, envelope: &SignedSensingEvidence, evidence: &SensingEvidence, grant_id: &[u8; 32], grant_digest: &[u8; 32], decision_commitment: &[u8; 32], now_unix_seconds: u64, ) -> bool

Source

fn calibration_commitment_matches( &self, evidence: &SensingEvidence, calibration_reference_id: &[u8; 32], calibration_artifact_commitment: &[u8; 32], ) -> bool

Source

fn payload_digest_matches( &self, evidence: &SensingEvidence, payload_digest: &[u8; 32], ) -> bool

Verify this digest against the exact immutable payload bytes referenced by the evidence. A signature over a caller-asserted digest is not enough.

Source

fn calibration_artifact_verified( &self, envelope: &SignedSensingEvidence, evidence: &SensingEvidence, now_unix_seconds: u64, ) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§