Record Class TokenFingerprint

java.lang.Object
java.lang.Record
com.yahoo.security.token.TokenFingerprint

public record TokenFingerprint(byte[] hashBytes) extends Record

A token fingerprint represents an opaque sequence of bytes that is expected to globally identify any particular token within a particular token domain.

Token fingerprints should not be used directly for access checks; use derived TokenCheckHash instances for this purpose.

Fingerprints are printed in the common hex:hex:hex:... format, e.g. 53:2e:4e:09:d5:4f:96:f4:1a:44:82:ef:f0:44:b9:a2

  • Field Details

    • FINGERPRINT_BITS

      public static final int FINGERPRINT_BITS
      See Also:
    • FINGERPRINT_BYTES

      public static final int FINGERPRINT_BYTES
      See Also:
    • FINGERPRINT_CONTEXT

      public static final byte[] FINGERPRINT_CONTEXT
  • Constructor Details

    • TokenFingerprint

      public TokenFingerprint(byte[] hashBytes)
      Creates an instance of a TokenFingerprint record class.
      Parameters:
      hashBytes - the value for the hashBytes record component
  • Method Details

    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toHexString

      public String toHexString()
    • toDelimitedHexString

      public String toDelimitedHexString()
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • of

      public static TokenFingerprint of(Token token)
    • ofRawBytes

      public static TokenFingerprint ofRawBytes(byte[] hashBytes)
    • ofHex

      public static TokenFingerprint ofHex(String hex)
    • hashBytes

      public byte[] hashBytes()
      Returns the value of the hashBytes record component.
      Returns:
      the value of the hashBytes record component