public static class JsonWebToken.Payload
extends com.google.api.client.json.GenericJson
com.google.api.client.util.GenericData.FlagsAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
JsonWebToken.Payload()
Constructs a new Payload using default settings.
|
JsonWebToken.Payload(com.google.api.client.util.Clock clock)
Constructs a new Payload with specific parameters.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAudience()
Returns the audience claim that identifies the audience that the JWT is intended for or
null for none. |
Long |
getExpirationTimeSeconds()
Returns the expiration time (in seconds) claim that identifies the expiration time on or
after which the token MUST NOT be accepted for processing or
null for none. |
Long |
getIssuedAtTimeSeconds()
Returns the issued at claim that identifies the time (in seconds) at which the JWT was issued
or
null for none. |
String |
getIssuer()
Returns the issuer claim that identifies the principal that issued the JWT or
null
for none. |
String |
getJwtId()
Returns the JWT ID claim that provides a unique identifier for the JWT or
null for
none. |
Long |
getNotBeforeTimeSeconds()
Returns the not before claim that identifies the time (in seconds) before which the token
MUST NOT be accepted for processing or
null for none. |
String |
getPrincipal()
Returns the principal claim that identifies the subject of the JWT or
null for none. |
String |
getType()
Returns the type claim that is used to declare a type for the contents of this JWT Claims Set
or
null for none. |
boolean |
isValidTime(long acceptableTimeSkewSeconds)
Returns whether the
getExpirationTimeSeconds() and getIssuedAtTimeSeconds() are
valid relative to the current time, optionally allowing for a clock skew. |
JsonWebToken.Payload |
setAudience(String audience)
Sets the audience claim that identifies the audience that the JWT is intended for or
null for none. |
JsonWebToken.Payload |
setExpirationTimeSeconds(Long expirationTimeSeconds)
Sets the expiration time claim that identifies the expiration time (in seconds) on or after
which the token MUST NOT be accepted for processing or
null for none. |
JsonWebToken.Payload |
setIssuedAtTimeSeconds(Long issuedAtTimeSeconds)
Sets the issued at claim that identifies the time (in seconds) at which the JWT was issued or
null for none. |
JsonWebToken.Payload |
setIssuer(String issuer)
Sets the issuer claim that identifies the principal that issued the JWT or
null for
none. |
JsonWebToken.Payload |
setJwtId(String jwtId)
Sets the JWT ID claim that provides a unique identifier for the JWT or
null for none. |
JsonWebToken.Payload |
setNotBeforeTimeSeconds(Long notBeforeTimeSeconds)
Sets the not before claim that identifies the time (in seconds) before which the token MUST
NOT be accepted for processing or
null for none. |
JsonWebToken.Payload |
setPrincipal(String principal)
Sets the principal claim that identifies the subject of the JWT or
null for none. |
JsonWebToken.Payload |
setType(String type)
Sets the type claim that is used to declare a type for the contents of this JWT Claims Set or
null for none. |
clone, getFactory, setFactory, toPrettyString, toStringentrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeysclear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, valuespublic JsonWebToken.Payload()
public JsonWebToken.Payload(com.google.api.client.util.Clock clock)
clock - Clock to use for expiration checkspublic Long getExpirationTimeSeconds()
null for none.public JsonWebToken.Payload setExpirationTimeSeconds(Long expirationTimeSeconds)
null for none.public Long getNotBeforeTimeSeconds()
null for none.public JsonWebToken.Payload setNotBeforeTimeSeconds(Long notBeforeTimeSeconds)
null for none.public Long getIssuedAtTimeSeconds()
null for none.public JsonWebToken.Payload setIssuedAtTimeSeconds(Long issuedAtTimeSeconds)
null for none.public String getIssuer()
null
for none.public JsonWebToken.Payload setIssuer(String issuer)
null for
none.public String getAudience()
null for none.public JsonWebToken.Payload setAudience(String audience)
null for none.public String getPrincipal()
null for none.public JsonWebToken.Payload setPrincipal(String principal)
null for none.public String getJwtId()
null for
none.public JsonWebToken.Payload setJwtId(String jwtId)
null for none.public String getType()
null for none.public JsonWebToken.Payload setType(String type)
null for none.public boolean isValidTime(long acceptableTimeSkewSeconds)
getExpirationTimeSeconds() and getIssuedAtTimeSeconds() are
valid relative to the current time, optionally allowing for a clock skew.
Default implementation checks that the expiration time
and issued at time are valid based on the
current time, allowing for the clock skew. Subclasses may
override.
acceptableTimeSkewSeconds - seconds of acceptable clock skewCopyright © 2011-2012 Google. All Rights Reserved.