public class JWT extends Object
From RFC 7519 Section 1. Introduction:
The suggested pronunciation of JWT is the same as the English word "jot".
The JWT is not Thread-Safe and should not be re-used.| Modifier and Type | Field and Description |
|---|---|
Object |
audience
Registered Claim
aud as defined by RFC 7519 Section 4.1.3. |
java.time.ZonedDateTime |
expiration
Registered Claim
exp as defined by RFC 7519 Section 4.1.4. |
java.time.ZonedDateTime |
issuedAt
Registered Claim
iat as defined by RFC 7519 Section 4.1.6. |
String |
issuer
Registered Claim
iss as defined by RFC 7519 Section 4.1.1. |
java.time.ZonedDateTime |
notBefore
Registered Claim
nbf as defined by RFC 7519 Section 4.1.5. |
Map<String,Object> |
otherClaims
This Map will contain all the claims that aren't specifically defined in the specification.
|
String |
subject
Registered Claim
sub as defined by RFC 7519 Section 4.1.2. |
String |
uniqueId
Registered Claim
jti as defined by RFC 7519 Section 4.1.7. |
| Constructor and Description |
|---|
JWT() |
public Object audience
aud as defined by RFC 7519 Section 4.1.3. Use of this claim is OPTIONAL.
The audience claim identifies the recipients that the JWT is intended for. This may be an array of strings or a
single string, in either case if the string value contains a : it must be a URI.
public java.time.ZonedDateTime expiration
exp as defined by RFC 7519 Section 4.1.4. Use of this claim is OPTIONAL.
The expiration time claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. The expiration time is expected to provided in UNIX time, or the number of seconds since Epoch.
public java.time.ZonedDateTime issuedAt
iat as defined by RFC 7519 Section 4.1.6. Use of this claim is OPTIONAL.
The issued at claim identifies the time at which the JWT was issued. The issued at time is expected to provided in UNIX time, or the number of seconds since Epoch.
public String issuer
iss as defined by RFC 7519 Section 4.1.1. Use of this claim is OPTIONAL.
The issuer claim identifies the principal that issued the JWT. If the value contains a : it must be a
URI.
public java.time.ZonedDateTime notBefore
nbf as defined by RFC 7519 Section 4.1.5. Use of this claim is OPTIONAL.
This claim identifies the time before which the JWT MUST NOT be accepted for processing. The not before value is expected to provided in UNIX time, or the number of seconds since Epoch.
public Map<String,Object> otherClaims
public String subject
sub as defined by RFC 7519 Section 4.1.2. Use of this claim is OPTIONAL.
The subject claim identifies the principal that is the subject of the JWT. If the value contains a :
it must be a URI.
public String uniqueId
jti as defined by RFC 7519 Section 4.1.7. Use of this claim is OPTIONAL.
The JWT unique ID claim provides a unique identifier for the JWT.
public static JWTDecoder getDecoder()
public static JWTEncoder getEncoder()
public JWT addClaim(String name, Object value)
name - The name of the JWT claim.value - The value of the JWT claim. This value is an object and is expected to properly serialize.public Map<String,Object> getAllClaims()
public BigDecimal getBigDecimal(String key)
public BigInteger getBigInteger(String key)
public Map<String,Object> getRawClaims()
public boolean isExpired()
public boolean isUnavailableForProcessing()
public JWT setExpiration(java.time.ZonedDateTime expiration)
public JWT setIssuedAt(java.time.ZonedDateTime issuedAt)
public JWT setNotBefore(java.time.ZonedDateTime notBefore)
Copyright © 2020. All rights reserved.