com.google.api.client.auth.jsontoken
Class JsonWebToken.Payload

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.client.auth.jsontoken.JsonWebToken.Payload
All Implemented Interfaces:
Cloneable, Map<String,Object>
Enclosing class:
JsonWebToken

public static class JsonWebToken.Payload
extends GenericJson

Payload as specified in Reserved Claim Names.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
JsonWebToken.Payload()
           
 
Method Summary
 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.
 
Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, setFactory, toPrettyString, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonWebToken.Payload

public JsonWebToken.Payload()
Method Detail

getExpirationTimeSeconds

public 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.


setExpirationTimeSeconds

public 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.


getNotBeforeTimeSeconds

public 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.


setNotBeforeTimeSeconds

public 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.


getIssuedAtTimeSeconds

public Long getIssuedAtTimeSeconds()
Returns the issued at claim that identifies the time (in seconds) at which the JWT was issued or null for none.


setIssuedAtTimeSeconds

public 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.


getIssuer

public String getIssuer()
Returns the issuer claim that identifies the principal that issued the JWT or null for none.


setIssuer

public JsonWebToken.Payload setIssuer(String issuer)
Sets the issuer claim that identifies the principal that issued the JWT or null for none.


getAudience

public String getAudience()
Returns the audience claim that identifies the audience that the JWT is intended for or null for none.


setAudience

public JsonWebToken.Payload setAudience(String audience)
Sets the audience claim that identifies the audience that the JWT is intended for or null for none.


getPrincipal

public String getPrincipal()
Returns the principal claim that identifies the subject of the JWT or null for none.


setPrincipal

public JsonWebToken.Payload setPrincipal(String principal)
Sets the principal claim that identifies the subject of the JWT or null for none.


getJwtId

public String getJwtId()
Returns the JWT ID claim that provides a unique identifier for the JWT or null for none.


setJwtId

public JsonWebToken.Payload setJwtId(String jwtId)
Sets the JWT ID claim that provides a unique identifier for the JWT or null for none.


getType

public 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.


setType

public 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.


isValidTime

public boolean isValidTime(long acceptableTimeSkewSeconds)
Returns whether the 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.

Parameters:
acceptableTimeSkewSeconds - seconds of acceptable clock skew


Copyright © 2011-2012 Google. All Rights Reserved.