pub struct SignedSensingEvidence { /* private fields */ }Expand description
Versioned signed evidence record. Fields are private to prevent post-signing
mutation outside the module; use verify before consuming it.
Implementations§
Source§impl SignedSensingEvidence
impl SignedSensingEvidence
pub fn sign( evidence: SensingEvidence, grant_id: [u8; 32], grant_digest: [u8; 32], decision_commitment: [u8; 32], adapter_id: u64, adapter_epoch: u32, capture_time: CaptureTimestamp, calibration_reference_id: [u8; 32], calibration_artifact_commitment: [u8; 32], payload_digest: [u8; 32], signing_key: &SigningKey, ) -> Result<Self, SignedEvidenceError>
pub const fn version(self) -> u16
pub const fn evidence(self) -> SensingEvidence
pub const fn grant_id(self) -> [u8; 32]
pub const fn grant_digest(self) -> [u8; 32]
pub const fn decision_commitment(self) -> [u8; 32]
pub const fn adapter_id(self) -> u64
pub const fn adapter_epoch(self) -> u32
pub const fn capture_time(self) -> CaptureTimestamp
pub const fn calibration_artifact_commitment(self) -> [u8; 32]
pub const fn calibration_reference_id(self) -> [u8; 32]
pub const fn payload_digest(self) -> [u8; 32]
pub const fn signature(self) -> [u8; 64]
Sourcepub fn encode_to(&self, out: &mut [u8]) -> Result<usize, SignedEvidenceError>
pub fn encode_to(&self, out: &mut [u8]) -> Result<usize, SignedEvidenceError>
Encode the fixed v1 transport record into caller storage. Insufficient output leaves the buffer untouched. Parsing does not imply trust.
Sourcepub fn decode_from(input: &[u8]) -> Result<Self, SignedEvidenceError>
pub fn decode_from(input: &[u8]) -> Result<Self, SignedEvidenceError>
Parse an exact v1 transport record into an unverified envelope.
Sourcepub fn canonical_digest(&self) -> [u8; 32]
pub fn canonical_digest(&self) -> [u8; 32]
Canonical digest with a versioned domain separator and explicit little-endian field encodings. The raw NQuin parity word is bound exactly as stored; this does not select either conflicting parity convention.
Sourcepub fn verify(
&self,
evidence: &SensingEvidence,
policy: &dyn SignedEvidencePolicy,
clock: &dyn TrustedEvidenceClock,
) -> Result<(), SignedEvidenceError>
pub fn verify( &self, evidence: &SensingEvidence, policy: &dyn SignedEvidencePolicy, clock: &dyn TrustedEvidenceClock, ) -> Result<(), SignedEvidenceError>
Verify signature and policy using a fresh reading from the trusted clock. This authenticates origin and authorized use only; it does not establish truth. Implementations must fail closed when current UTC is unavailable.
Trait Implementations§
Source§impl Clone for SignedSensingEvidence
impl Clone for SignedSensingEvidence
impl Copy for SignedSensingEvidence
Source§impl Debug for SignedSensingEvidence
impl Debug for SignedSensingEvidence
impl Eq for SignedSensingEvidence
Source§impl PartialEq for SignedSensingEvidence
impl PartialEq for SignedSensingEvidence
impl StructuralPartialEq for SignedSensingEvidence
Auto Trait Implementations§
impl Freeze for SignedSensingEvidence
impl RefUnwindSafe for SignedSensingEvidence
impl Send for SignedSensingEvidence
impl Sync for SignedSensingEvidence
impl Unpin for SignedSensingEvidence
impl UnsafeUnpin for SignedSensingEvidence
impl UnwindSafe for SignedSensingEvidence
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more