pub struct HostSessionProof {
pub host_id: HostId,
pub client_nonce: Nonce,
pub host_challenge: Challenge,
pub community_id: Option<CommunityId>,
pub delegation_epoch: Option<u64>,
pub issued_at: u64,
}Expand description
The host’s proof of key possession in session.welcome. Signed by the host key.
Fields§
§host_id: HostId2: the host.
client_nonce: Nonce3: from session.hello.
host_challenge: Challenge4: the challenge sent in this welcome.
community_id: Option<CommunityId>5: the bound or requested community.
delegation_epoch: Option<u64>6: the epoch the host operates under for field 5.
issued_at: u647: ms since the epoch.
Implementations§
Source§impl HostSessionProof
impl HostSessionProof
Sourcepub fn verify_for_client(
signed: &SignedJson,
host_public_key: &PublicKey,
client_nonce: &Nonce,
pair: Option<&ValidPair>,
) -> Result<Signed<Self>, SessionProofError>
pub fn verify_for_client( signed: &SignedJson, host_public_key: &PublicKey, client_nonce: &Nonce, pair: Option<&ValidPair>, ) -> Result<Signed<Self>, SessionProofError>
The client’s check (§4.5): verifies under host_public_key, requires host_id to
derive from it and client_nonce to be the client’s fresh nonce. When a community is
named, pair must be a (descriptor, delegation) pair already validated by
super::validate_pair for that community, delegating to this host_id under this
epoch; its min_suite then applies to the proof’s signature.
§Errors
SessionProofError for a bad signature, encoding or mismatch.
Trait Implementations§
Source§impl Clone for HostSessionProof
impl Clone for HostSessionProof
Source§fn clone(&self) -> HostSessionProof
fn clone(&self) -> HostSessionProof
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostSessionProof
impl Debug for HostSessionProof
Source§impl Decode for HostSessionProof
impl Decode for HostSessionProof
Source§impl Encode for HostSessionProof
impl Encode for HostSessionProof
impl Eq for HostSessionProof
Source§impl PartialEq for HostSessionProof
impl PartialEq for HostSessionProof
Source§impl SignedObject for HostSessionProof
impl SignedObject for HostSessionProof
Source§const CONTEXT: Context = Context::HostSession
const CONTEXT: Context = Context::HostSession
The context the verifier supplies for this type (§3.5).
Source§fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
Decodes canonical bytes without verifying them. Receivers use
Signed::verify_and_decode. Read moreSource§fn sign(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
fn sign(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
Encodes and signs (hedged). Read more
Source§fn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
fn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
Encodes and signs deterministically. Golden test vectors only. Read more
impl StructuralPartialEq for HostSessionProof
Auto Trait Implementations§
impl Freeze for HostSessionProof
impl RefUnwindSafe for HostSessionProof
impl Send for HostSessionProof
impl Sync for HostSessionProof
impl Unpin for HostSessionProof
impl UnsafeUnpin for HostSessionProof
impl UnwindSafe for HostSessionProof
Blanket Implementations§
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
Mutably borrows from an owned value. Read more