public abstract class JWT extends java.lang.Object implements DecodedJWT
Constructor and Description |
---|
JWT() |
Modifier and Type | Method and Description |
---|---|
static JWTCreator.Builder |
create()
Returns a JWT builder used to create and sign jwt tokens
|
static JWT |
decode(java.lang.String token)
Decode a given JWT token.
|
static Verification |
require(Algorithm algorithm)
Returns a
JWTVerifier builder with the algorithm to be used to validate token signature. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getToken
getAudience, getClaim, getClaims, getExpiresAt, getId, getIssuedAt, getIssuer, getNotBefore, getSubject
getAlgorithm, getContentType, getHeaderClaim, getKeyId, getType
getSignature
public static JWT decode(java.lang.String token) throws JWTDecodeException
Note that this method doesn't verify the token's signature! Use it only if you trust the token or you already verified it.
token
- with jwt format as string.JWTDecodeException
- if any part of the token contained an invalid jwt or JSON format of each of the jwt parts.public static Verification require(Algorithm algorithm)
JWTVerifier
builder with the algorithm to be used to validate token signature.algorithm
- that will be used to verify the token's signature.JWTVerifier
builderjava.lang.IllegalArgumentException
- if the provided algorithm is null.public static JWTCreator.Builder create()