Package org.forgerock.json.jose.builders
Class JwtClaimsSetBuilder
java.lang.Object
org.forgerock.json.jose.builders.JwtClaimsSetBuilder
An implementation of a JWT Claims Set builder that provides a fluent builder pattern to creating JWT Claims Sets.
See JwtClaimsSet
for information on the JwtClaimsSet object that this builder
creates.
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the JWT's intended audience list in the Claims Set.build()
Creates a JwtClaimsSet instance from the claims set in this builder.Adds a custom claim to the JWT Claims Set.Sets all of the claims the JWT Claims Set with the values contained in the specified map.Sets the expiration time of the JWT in the Claims Set.Sets the time the JWT was issued at, in the Claims Set.Sets the issuer this JWT was issued by.Sets the issuer this JWT was issued by.Sets the unique ID of the JWT.Sets the time the JWT is not allowed to be processed before, in the Claims Set.Sets the subject this JWT is issued to.Sets the subject this JWT is issued to.Sets the type of the contents of the Claims Set.
-
Constructor Details
-
JwtClaimsSetBuilder
public JwtClaimsSetBuilder()
-
-
Method Details
-
claim
Adds a custom claim to the JWT Claims Set.- Parameters:
key
- The claim name.claim
- The claim value.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
claims
Sets all of the claims the JWT Claims Set with the values contained in the specified map.- Parameters:
claims
- The Map to use to set the claims.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
typ
Sets the type of the contents of the Claims Set.- Parameters:
typ
- The Claims Set content type.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
jti
Sets the unique ID of the JWT.- Parameters:
jti
- The JWT's ID.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
iss
Sets the issuer this JWT was issued by.- Parameters:
iss
- The JWT's issuer.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
iss
Sets the issuer this JWT was issued by.- Parameters:
iss
- The JWT's issuer.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
sub
Sets the subject this JWT is issued to.- Parameters:
sub
- The JWT's subject.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
sub
Sets the subject this JWT is issued to.- Parameters:
sub
- The JWT's subject.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
aud
Sets the JWT's intended audience list in the Claims Set.- Parameters:
aud
- The JWT's audience.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
iat
Sets the time the JWT was issued at, in the Claims Set.- Parameters:
iat
- The JWT's issued at time.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
nbf
Sets the time the JWT is not allowed to be processed before, in the Claims Set.- Parameters:
nbf
- The JWT's not before time.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
exp
Sets the expiration time of the JWT in the Claims Set.- Parameters:
exp
- The JWT's expiration time.- Returns:
- This JwtClaimsSetBuilder.
- See Also:
-
build
Creates a JwtClaimsSet instance from the claims set in this builder.- Returns:
- A JwtClaimsSet instance.
-