public class JWT extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JWT.JWTDecodeException |
| Constructor and Description |
|---|
JWT() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gson.JsonObject |
decode(String token,
String secret) |
static com.google.gson.JsonObject |
decodeUnverified(String token) |
static String |
generateHS256Token(User user,
String secret,
int ttl)
Generates a signed JSON Web Token appended with a signature which can be used to validate the JWT by whoever
knows the specified secret.
|
static String |
generateUnsignedToken(User user,
int ttl)
Generates an unsigned JSON Web Token.
|
public static String generateUnsignedToken(User user, int ttl)
public static String generateHS256Token(User user, String secret, int ttl) throws InvalidKeyException, NoSuchAlgorithmException
public static com.google.gson.JsonObject decodeUnverified(String token) throws JWT.JWTDecodeException
JWT.JWTDecodeExceptionpublic static com.google.gson.JsonObject decode(String token, String secret) throws JWT.JWTDecodeException, InvalidKeyException, NoSuchAlgorithmException
Copyright © 2018 Space Applications Services. All rights reserved.