Class TokenGenerator

java.lang.Object
com.yahoo.security.token.TokenGenerator

public class TokenGenerator extends Object

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 Details

    • TokenGenerator

      public TokenGenerator()
  • Method Details