Skip to main content

parse_invite

Function parse_invite 

Source
pub fn parse_invite(blob: &str) -> Result<Invite>
Expand description

Decodes and verifies an invite blob.

Verification is mandatory and total: an invite that fails any check is an error, never a partially-trusted value. In order, cheap before expensive:

  1. base64url decodes, and the blob is structurally complete;
  2. v == 1 and no unknown flag bits;
  3. the address parses in canonical form;
  4. the petname, when present, is displayable (no Cc, no Cf);
  5. derive_address(public_key) == address;
  6. the signature, when present, verifies under public_key.

ยงErrors

Returns MlsError::InvalidMessage for a malformed or truncated blob, MlsError::VerificationFailed when the address does not derive from the key or a present signature does not verify.