Class LinkRequest

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

public final class LinkRequest extends Object
The request a new owner device shows (AVP SPEC 11.6): its ephemeral public key. It travels to an existing owner device out of band, which shows the same confirmationCode() and, once the owner confirms the two match, answers with a LinkGrant (LinkSession.approve(OwnerIdentity, LinkRequest, Predicate)).

It holds no secret.

Since:
1.0.0
  • Method Details

    • parse

      public static LinkRequest parse(String text)
      Reads a link request from pasted text. Whitespace anywhere in the text is ignored.
      Parameters:
      text - the pasted text
      Returns:
      the request
      Throws:
      AltsException - of kind INVALID_INPUT if the text is not a version 2 link request
      Since:
      1.0.0
    • text

      public String text()
      The token text to carry to the existing owner device.
      Returns:
      the text
      Since:
      1.0.0
    • confirmationCode

      public String confirmationCode()
      The 6-digit code both devices show (SPEC 11.6), leading zeros kept.
      Returns:
      the code
      Since:
      1.0.0
    • equals

      public boolean equals(Object o)
      Whether o is a request 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 confirmation code.
      Overrides:
      toString in class Object
      Returns:
      a description
      Since:
      1.0.0