Package com.yahoo.security.token
Class TokenGenerator
java.lang.Object
com.yahoo.security.token.TokenGenerator
Generates new Token instances that encapsulate a given number of cryptographically
secure random bytes and, with a sufficiently high number of bytes (>= 16), can be expected
to be globally unique and computationally infeasible to guess or brute force.
Tokens are returned in a printable and copy/paste-friendly form (Base62) with an optional prefix string.
Example of token string generated with the prefix "itsa_me_mario_" and 32 random bytes:
itsa_me_mario_nALfICMyrC4NFagwAkiOdGh80DPS1vSUPprGUKVPLya
Tokens are considered secret information, and must be treated as such.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokengenerateToken(TokenDomain domain, String prefix, int nRandomBytes)
-
Constructor Details
-
TokenGenerator
public TokenGenerator()
-
-
Method Details
-
generateToken
-