Skip to main content

SessionLivenessStatement

Struct SessionLivenessStatement 

Source
pub struct SessionLivenessStatement {
    pub type_: String,
    pub session_ref: String,
    pub participant_ref: String,
    pub joining_agent: String,
    pub nonce_digest: String,
    pub challenge_issued_at: String,
    pub response_signed_at: String,
}
Expand description

Host-signed evidence that a specific join answered a specific challenge, with both endpoints of the window it took.

Fields§

§type_: String§session_ref: String

session_id the join belongs to. Must equal the participant statement’s session_ref; a verifier checks this rather than trusting the link.

§participant_ref: String

Artifact id of the participant envelope this attests. The link that makes the evidence portable: given a participant receipt, a verifier can find the liveness statement, and given this, they can find what it describes.

§joining_agent: String

Joining agent’s Ed25519 public key, base64url-no-pad. Duplicated from the participant statement deliberately: it is bound into these signed bytes, so this attestation cannot be re-pointed at a different join by editing the reference alone.

§nonce_digest: String

sha256:<hex> of the nonce, never the nonce itself. The nonce is single-use liveness material; publishing it in a durable artifact would hand a replayer the exact string the host was expecting. A digest still lets the host’s own records be reconciled against this.

§challenge_issued_at: String

RFC 3339. When the host minted the nonce.

§response_signed_at: String

RFC 3339. The signed_at the joining agent bound into its challenge response — the agent’s own claim about when it answered.

Implementations§

Source§

impl SessionLivenessStatement

Source

pub fn new( session_ref: impl Into<String>, participant_ref: impl Into<String>, joining_agent: impl Into<String>, nonce: &str, challenge_issued_at: impl Into<String>, response_signed_at: impl Into<String>, ) -> Self

Source

pub fn interval_seconds(&self) -> Option<i64>

The challenge window in seconds: issue to answer.

None when either timestamp will not parse, or when the answer predates the challenge. A negative interval is not a small window — it means at least one clock is wrong or one timestamp was fabricated, and reporting it as a number would launder that into a reassuring value. The caller must handle None as “cannot be evaluated”.

Source

pub fn canonical_for_signing(&self) -> String

Canonical signing bytes. Same pipe-delimited shape as the other session statements, every field positional so none can be omitted.

Source

pub fn sign_as_host( &self, host_signer: &dyn Signer, ) -> Result<String, SignerError>

Signed by the host, not the joining agent. The host is the party that issued the challenge and observed the answer; the agent cannot attest to when it was asked.

Trait Implementations§

Source§

impl Clone for SessionLivenessStatement

Source§

fn clone(&self) -> SessionLivenessStatement

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 SessionLivenessStatement

Source§

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

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

impl<'de> Deserialize<'de> for SessionLivenessStatement

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 Eq for SessionLivenessStatement

Source§

impl PartialEq for SessionLivenessStatement

Source§

fn eq(&self, other: &SessionLivenessStatement) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SessionLivenessStatement

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
Source§

impl StructuralPartialEq for SessionLivenessStatement

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 = !

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V