pub struct AdmitHello {
pub kind: String,
pub v: u32,
pub node_id: String,
pub pubkey: String,
pub platform: String,
pub capabilities: Vec<String>,
pub genesis_hash: String,
pub ts: u64,
pub noise_static_pub: String,
pub sig: String,
}Expand description
Wire form of the first frame (JSON). Binary fields are lowercase hex.
Fields§
§kind: StringAlways HELLO_KIND.
v: u32Protocol version, currently 1.
node_id: Stringnode_id_from_pubkey(pubkey).
pubkey: StringEd25519 public key (64 hex).
platform: StringFree-form platform string.
capabilities: Vec<String>Capability tags; CAP_LEAF marks a leaf-class peer.
genesis_hash: StringCluster genesis hash the peer believes in (64 hex).
ts: u64Unix seconds when signed.
noise_static_pub: StringThe peer’s Noise static public key (64 hex), or empty.
sig: StringSignature (128 hex) over signed_bytes.
Implementations§
Source§impl AdmitHello
impl AdmitHello
Sourcepub fn sign(
key: &SigningKey,
handshake_hash: &[u8],
noise_static_pub: &[u8],
genesis: &[u8; 32],
ts: u64,
platform: &str,
capabilities: Vec<String>,
) -> Self
pub fn sign( key: &SigningKey, handshake_hash: &[u8], noise_static_pub: &[u8], genesis: &[u8; 32], ts: u64, platform: &str, capabilities: Vec<String>, ) -> Self
Build and sign a hello for the session identified by
handshake_hash. noise_static_pub is this side’s Noise static
public key (what the peer sees as its remote static).
Sourcepub fn parse_frame(data: &[u8]) -> Option<Result<Self, HelloFailure>>
pub fn parse_frame(data: &[u8]) -> Option<Result<Self, HelloFailure>>
Classify a first frame: None when it is not a hello at all (the
legacy path), Some(Err) when it claims to be one but is broken.
Sourcepub fn verify(
&self,
binding: Option<&ChannelBinding<'_>>,
now: u64,
) -> Result<VerifiedHello, HelloFailure>
pub fn verify( &self, binding: Option<&ChannelBinding<'_>>, now: u64, ) -> Result<VerifiedHello, HelloFailure>
Verify everything that needs no policy: id/key binding, session binding, signature, timestamp. Order follows plan section 1.5.
Trait Implementations§
Source§impl Clone for AdmitHello
impl Clone for AdmitHello
Source§impl Debug for AdmitHello
impl Debug for AdmitHello
Source§impl<'de> Deserialize<'de> for AdmitHello
impl<'de> Deserialize<'de> for AdmitHello
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AdmitHello
impl RefUnwindSafe for AdmitHello
impl Send for AdmitHello
impl Sync for AdmitHello
impl Unpin for AdmitHello
impl UnsafeUnpin for AdmitHello
impl UnwindSafe for AdmitHello
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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