|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nimbusds.jwt.ClaimsSet
public class ClaimsSet
JSON Web Token (JWT) claims set.
Supports all reserved claims of the JWT
specification:
The set may also carry custom claims; these will
be serialised and parsed along the reserved ones.
| Constructor Summary | |
|---|---|
ClaimsSet()
Creates a new empty claims set. |
|
| Method Summary | |
|---|---|
String[] |
getAudienceClaim()
Gets the audience ( aud) clam. |
Object |
getCustomClaim(String name)
Gets a custom (public or private) claim. |
Map<String,Object> |
getCustomClaims()
Gets the custom (non-reserved) claims. |
long |
getExpirationTimeClaim()
Gets the expiration time ( exp) claim. |
long |
getIssuedAtClaim()
Gets the issued-at ( iat) claim. |
String |
getIssuerClaim()
Gets the issuer ( iss) claim. |
String |
getJWTIDClaim()
Gets the JWT ID ( jti) claim. |
long |
getNotBeforeClaim()
Gets the not-before ( nbf) claim. |
static Set<String> |
getReservedNames()
Gets the reserved claim names. |
String |
getSubjectClaim()
Gets the subject ( sub) claim. |
String |
getTypeClaim()
Gets the type ( typ) claim. |
static ClaimsSet |
parse(net.minidev.json.JSONObject json)
Parses a JSON Web Token (JWT) claims set from the specified JSON object representation. |
void |
setAudienceClaim(String[] aud)
Sets the audience ( aud) clam. |
void |
setCustomClaim(String name,
Object value)
Sets a custom (public or private) claim. |
void |
setCustomClaims(Map<String,Object> customClaims)
Sets the custom (non-reserved) claims. |
void |
setExpirationTimeClaim(long exp)
Sets the expiration time ( exp) claim. |
void |
setIssuedAtClaim(long iat)
Sets the issued-at ( iat) claim. |
void |
setIssuerClaim(String iss)
Sets the issuer ( iss) claim. |
void |
setJWTIDClaim(String jti)
Sets the JWT ID ( jti) claim. |
void |
setNotBeforeClaim(long nbf)
Sets the not-before ( nbf) claim. |
void |
setSubjectClaim(String sub)
Sets the subject ( sub) claim. |
void |
setTypeClaim(String typ)
Sets the type ( typ) claim. |
net.minidev.json.JSONObject |
toJSONObject()
Returns the JSON object representation of the claims set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClaimsSet()
| Method Detail |
|---|
public static Set<String> getReservedNames()
public String getIssuerClaim()
ReadOnlyClaimsSetiss) claim.
getIssuerClaim in interface ReadOnlyClaimsSetnull if not specified.public void setIssuerClaim(String iss)
iss) claim.
iss - The issuer claim, null if not specified.public String getSubjectClaim()
ReadOnlyClaimsSetsub) claim.
getSubjectClaim in interface ReadOnlyClaimsSetnull if not specified.public void setSubjectClaim(String sub)
sub) claim.
sub - The subject claim, null if not specified.public String[] getAudienceClaim()
ReadOnlyClaimsSetaud) clam.
getAudienceClaim in interface ReadOnlyClaimsSetnull if not specified.public void setAudienceClaim(String[] aud)
aud) clam.
aud - The audience claim, null if not specified.public long getExpirationTimeClaim()
ReadOnlyClaimsSetexp) claim.
getExpirationTimeClaim in interface ReadOnlyClaimsSetpublic void setExpirationTimeClaim(long exp)
exp) claim.
exp - The expiration time, -1 if not specified.public long getNotBeforeClaim()
ReadOnlyClaimsSetnbf) claim.
getNotBeforeClaim in interface ReadOnlyClaimsSetpublic void setNotBeforeClaim(long nbf)
nbf) claim.
nbf - The not-before claim, -1 if not specified.public long getIssuedAtClaim()
ReadOnlyClaimsSetiat) claim.
getIssuedAtClaim in interface ReadOnlyClaimsSetpublic void setIssuedAtClaim(long iat)
iat) claim.
iat - The issued-at claim, -1 if not specified.public String getJWTIDClaim()
ReadOnlyClaimsSetjti) claim.
getJWTIDClaim in interface ReadOnlyClaimsSetnull if not specified.public void setJWTIDClaim(String jti)
jti) claim.
jti - The JWT ID claim, null if not specified.public String getTypeClaim()
ReadOnlyClaimsSettyp) claim.
getTypeClaim in interface ReadOnlyClaimsSetnull if not specified.public void setTypeClaim(String typ)
typ) claim.
typ - The type claim, null if not specified.public Object getCustomClaim(String name)
ReadOnlyClaimsSet
getCustomClaim in interface ReadOnlyClaimsSetname - The name of the custom claim. Must not be null.
null if not specified.
public void setCustomClaim(String name,
Object value)
name - The name of the custom claim. Must not be null.value - The value of the custom claim, should map to a valid
JSON entity, null if not specified.
IllegalArgumentException - If the specified custom claim name
matches a reserved claim name.public Map<String,Object> getCustomClaims()
ReadOnlyClaimsSet
getCustomClaims in interface ReadOnlyClaimsSetpublic void setCustomClaims(Map<String,Object> customClaims)
customClaims - The custom claims, empty map or null if
none.public net.minidev.json.JSONObject toJSONObject()
ReadOnlyClaimsSet
toJSONObject in interface ReadOnlyClaimsSet
public static ClaimsSet parse(net.minidev.json.JSONObject json)
throws ParseException
json - The JSON object to parse. Must not be null.
ParseException - If the specified JSON object doesn't represent
a valid JWT claims set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||