com.nimbusds.jwt
Interface ReadOnlyJWTClaimsSet

All Known Implementing Classes:
JWTClaimsSet

public interface ReadOnlyJWTClaimsSet

Read-only view of a JWTClaimsSet.

Version:
$version$ (2013-02-21)
Author:
Vladimir Dzhuvinov, Justin Richer

Method Summary
 Map<String,Object> getAllClaims()
          Gets all claims, both reserved and custom, as a single map.
 List<String> getAudience()
          Gets the audience (aud) clam.
 Object getClaim(String name)
          Gets a single claim by name, whether reserved or custom.
 Object getCustomClaim(String name)
          Gets a custom (non-reserved) claim.
 Map<String,Object> getCustomClaims()
          Gets the custom (non-reserved) claims.
 Date getExpirationTime()
          Gets the expiration time (exp) claim.
 String getIssuer()
          Gets the issuer (iss) claim.
 Date getIssueTime()
          Gets the issued-at (iat) claim.
 String getJWTID()
          Gets the JWT ID (jti) claim.
 Date getNotBeforeTime()
          Gets the not-before (nbf) claim.
 String getSubject()
          Gets the subject (sub) claim.
 String getType()
          Gets the type (typ) claim.
 net.minidev.json.JSONObject toJSONObject()
          Returns the JSON object representation of the claims set.
 

Method Detail

getIssuer

String getIssuer()
Gets the issuer (iss) claim.

Returns:
The issuer claim, null if not specified.

getSubject

String getSubject()
Gets the subject (sub) claim.

Returns:
The subject claim, null if not specified.

getAudience

List<String> getAudience()
Gets the audience (aud) clam.

Returns:
The audience claim, null if not specified.

getExpirationTime

Date getExpirationTime()
Gets the expiration time (exp) claim.

Returns:
The expiration time, null if not specified.

getNotBeforeTime

Date getNotBeforeTime()
Gets the not-before (nbf) claim.

Returns:
The not-before claim, null if not specified.

getIssueTime

Date getIssueTime()
Gets the issued-at (iat) claim.

Returns:
The issued-at claim, null if not specified.

getJWTID

String getJWTID()
Gets the JWT ID (jti) claim.

Returns:
The JWT ID claim, null if not specified.

getType

String getType()
Gets the type (typ) claim.

Returns:
The type claim, null if not specified.

getCustomClaim

Object getCustomClaim(String name)
Gets a custom (non-reserved) claim.

Parameters:
name - The name of the custom claim. Must not be null.
Returns:
The value of the custom claim, null if not specified.

getCustomClaims

Map<String,Object> getCustomClaims()
Gets the custom (non-reserved) claims.

Returns:
The custom claims, as a unmodifiable map, empty map if none.

getClaim

Object getClaim(String name)
Gets a single claim by name, whether reserved or custom.

Parameters:
name - The name of the claim to get. Must not be null.
Returns:
The value of the claim, null if not specified.

getAllClaims

Map<String,Object> getAllClaims()
Gets all claims, both reserved and custom, as a single map.

Note that the reserved claims Expiration-Time (exp), Not-Before-Time (nbf) and Issued-At (iat) will be returned as java.util.Date instances.

Returns:
All claims, as an unmodifiable map, empty map if none.

toJSONObject

net.minidev.json.JSONObject toJSONObject()
Returns the JSON object representation of the claims set.

Returns:
The JSON object representation.


Copyright © 2013 NimbusDS. All Rights Reserved.