Class InviteToken

java.lang.Object
lol.trq.alts.vault.InviteToken

public final class InviteToken extends Object
The token a joiner gives the owner (AVP SPEC 11.3): the joiner's two public keys, its home host (key and locator), and the home host's signed acceptance to carry the repository for that member. The joiner gets one from SharedVault.prepareJoin(VaultHost, VaultIdentity, RepoLocator); the owner passes it to SharedVault.invite(InviteToken), which verifies the acceptance and wraps the data key to exactly this token's key, never to one a host served.

It holds no secret: its text() is meant to be pasted to the owner. An owner who wants to be sure the token came from the person they invite compares fingerprint() with the one that person's device shows (VaultIdentity.fingerprint()).

Since:
1.0.0
  • Method Details

    • parse

      public static InviteToken parse(String text)
      Reads an invite token from pasted text. Whitespace anywhere in the text is ignored.
      Parameters:
      text - the pasted text
      Returns:
      the token
      Throws:
      AltsException - of kind INVALID_INPUT if the text is not a version 2 invite token; whether its acceptance verifies is decided by SharedVault.invite(InviteToken)
      Since:
      1.0.0
    • text

      public String text()
      The token text to give the owner.
      Returns:
      the text
      Since:
      1.0.0
    • memberId

      public String memberId()
      The joiner's member id: its Ed25519 public key, base64.
      Returns:
      the member id
      Since:
      1.0.0
    • fingerprint

      public String fingerprint()
      The joiner's key fingerprint (SPEC 3.2), xxxx-xxxx-xxxx-xxxx, to compare out of band.
      Returns:
      the fingerprint
      Since:
      1.0.0
    • homeHostKey

      public String homeHostKey()
      The key of the joiner's home host, base64.
      Returns:
      the host key
      Since:
      1.0.0
    • homeHostLocator

      public String homeHostLocator()
      Where the joiner's home host is reached.
      Returns:
      the host locator
      Since:
      1.0.0
    • expiresAt

      public Instant expiresAt()
      When the home host's acceptance expires; the owner must invite before then.
      Returns:
      the expiry
      Since:
      1.0.0
    • equals

      public boolean equals(Object o)
      Whether o is a token with the same text.
      Overrides:
      equals in class Object
      Parameters:
      o - the other object
      Returns:
      whether they are equal
      Since:
      1.0.0
    • hashCode

      public int hashCode()
      Hashes what equals(Object) compares.
      Overrides:
      hashCode in class Object
      Returns:
      the hash
      Since:
      1.0.0
    • toString

      public String toString()
      The joiner's fingerprint and home host.
      Overrides:
      toString in class Object
      Returns:
      a description
      Since:
      1.0.0