private String generateTokenString ( ) throws Exception { //Renew age //Stringify token data StringBuilder dataString = new StringBuilder ( ) ; dataString . append ( getUserId ( ) ) . append ( SEPARATOR ) . append ( getUsername ( ) ) . append ( SEPARATOR ) . append ( getExpirationDate ( ) . getTime ( ) ) . append ( SEPARATOR ) . append ( attributesHash ) ; // Encrypt token data string String newTokenString = encryptor . encrypt ( dataString . toString ( ) ) ; newTokenString = BaseEncoding . base16 ( ) . encode ( newTokenString . getBytes ( ) ) ; tokenString = newTokenString ; return newTokenString ; }
Generates a tokenString with a new expiration date and assigns it .