Skip to content

Struct ids::InviteSecret

zaun_community_protocol::ids::InviteSecret · Struct

pub struct InviteSecret(…)

An invitation secret: 32 random bytes, shown once. Never logged: Debug is redacted and it has no Display. Zeroized on drop.

pub const fn from_bytes(bytes: [u8; 32]) -> Self

Wraps raw bytes.

pub fn random() -> Result<Self, RngError>

A fresh secret.

RngError when the CSPRNG fails.

pub const fn expose(&self) -> &[u8; 32]

The raw bytes (for hashing before storage; hosts store only a hash).

pub fn expose_b64(&self) -> String

Base64url, for the one place it is shown: the invitation link.

pub fn from_b64(text: &str) -> Result<Self, B64Error>

Strict base64url.

A non-canonical encoding or a wrong length.

Clone, Debug, Deserialize<'de>, Drop, Eq, PartialEq, Serialize, StructuralPartialEq, Zeroize

Full rustdoc page