pub struct GroupKey { /* private fields */ }Expand description
Group Key is used to join a group and authorize membership.
Notes:
-
Currently only secret-based authentication is implemented.
-
Group Id is derived by hashing the secret bytes with the group configuration and the state machine identifier. See
GroupIdfor more details on how the group id is derived. -
During handshake, peers prove knowledge of the secret without revealing the secret itself by generating a proof of knowledge derived from the secret and the shared random value for the link.
Implementations§
Source§impl GroupKey
impl GroupKey
Sourcepub fn from_secret(secret: impl Into<Digest>) -> Self
pub fn from_secret(secret: impl Into<Digest>) -> Self
Create a new GroupKey from the given secret UniqueId.
Sourcepub const fn secret(&self) -> &Digest
pub const fn secret(&self) -> &Digest
Gets the underlying secret UniqueId.
This should never be transmitted over the network, only proofs of knowledge should be sent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GroupKey
impl<'de> Deserialize<'de> for GroupKey
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for GroupKey
impl Eq for GroupKey
impl StructuralPartialEq for GroupKey
Auto Trait Implementations§
impl Freeze for GroupKey
impl RefUnwindSafe for GroupKey
impl Send for GroupKey
impl Sync for GroupKey
impl Unpin for GroupKey
impl UnsafeUnpin for GroupKey
impl UnwindSafe for GroupKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Datum for T
impl<T> Datum for T
type DecodeError = Error
type EncodeError = Error
Source§fn encode(&self) -> Result<Bytes, <T as Datum>::EncodeError>
fn encode(&self) -> Result<Bytes, <T as Datum>::EncodeError>
Serializes the datum into bytes for sending over the network.
Source§fn decode(bytes: &[u8]) -> Result<T, <T as Datum>::DecodeError>
fn decode(bytes: &[u8]) -> Result<T, <T as Datum>::DecodeError>
Deserializes the datum from bytes received over the network.
Source§fn derived_stream_id() -> StreamId
fn derived_stream_id() -> StreamId
Returns the default stream id derived from the datum type name.
This is the stream id used if no custom stream id is provided when
building producers or consumers for this datum type.
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> RedactedFmtExt for T
impl<T> RedactedFmtExt for T
Source§impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
fn sign_with_key(self, key: &impl SigningAlgorithm) -> Result<String, Error>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.