Class StoredToken

  • All Implemented Interfaces:
    StoredSecret

    public final class StoredToken
    extends Object
    implements StoredSecret
    A security token, usually acquired by some authentication and identity services.
    • Constructor Detail

      • StoredToken

        public StoredToken​(char[] value,
                           StoredTokenType type)
        Creates a token object with a value and the specified type for a target identity.
        Parameters:
        value - token value
        type - token type
    • Method Detail

      • getType

        public StoredTokenType getType()
        The type of the security token.
        Returns:
        token type
      • getValue

        public char[] getValue()
        The raw contents of the token.
        Returns:
        token value
      • clear

        public void clear()
        Clear the token value.
        Specified by:
        clear in interface StoredSecret
      • equals

        public boolean equals​(Object o)
        Compares an object to this StoredToken for equality.
        Overrides:
        equals in class Object
        Parameters:
        o - The object to compare.
        Returns:
        True is equal; false otherwise.
      • hashCode

        public int hashCode()
        Gets a hash code based on the contents of the token.
        Overrides:
        hashCode in class Object
        Returns:
        32-bit hash code.