Class CWTClaimsSetBuilder
java.lang.Object
com.authlete.cwt.CWTClaimsSetBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet the "aud (3)" claim.build()Build an instance of theCWTClaimsSetclass.cti(byte[] identifier) Set the "cti (7)" claim.Set the "cti (7)" claim.exp(long expirationTime) Set the "exp (4)" claim.Set the "exp (4)" claim.iat(long issuedAt) Set the "iat (6)" claim.Set the "iat (6)" claim.Set the "iss (1)" claim.nbf(long notBefore) Set the "nbf (5)" claim.Set the "nbf (5)" claim.nonce(byte[] nonce) Set the "Nonce (10)" claim.Set the "Nonce (10)" claim.Add a claim.Set the "sub (2)" claim.ttl(long ttl) Set the "ttl (65534)" claim.
-
Constructor Details
-
CWTClaimsSetBuilder
public CWTClaimsSetBuilder()
-
-
Method Details
-
put
Add a claim.- Parameters:
key- The key of the claim. A pre-defined numeric claim key (e.g.CWTClaims.ISS) or a string name.value- The value of the claim.- Returns:
thisobject.
-
iss
Set the "iss (1)" claim.- Parameters:
issuer- The value of theissclaim.- Returns:
thisobject.
-
sub
Set the "sub (2)" claim.- Parameters:
subject- The value of thesubclaim.- Returns:
thisobject.
-
aud
Set the "aud (3)" claim.- Parameters:
audience- The value of theaudclaim.- Returns:
thisobject.
-
exp
Set the "exp (4)" claim.- Parameters:
expirationTime- The value of theexpclaim.- Returns:
thisobject.
-
exp
Set the "exp (4)" claim.- Parameters:
expirationTime- The value of theexpclaim. A time expressed in seconds elapsed since the Unix epoch.- Returns:
thisobject.
-
nbf
Set the "nbf (5)" claim.- Parameters:
notBefore- The value of thenbfclaim.- Returns:
thisobject.
-
nbf
Set the "nbf (5)" claim.- Parameters:
notBefore- The value of thenbfclaim. A time expressed in seconds elapsed since the Unix epoch.- Returns:
thisobject.
-
iat
Set the "iat (6)" claim.- Parameters:
issuedAt- The value of theiatclaim.- Returns:
thisobject.
-
iat
Set the "iat (6)" claim.- Parameters:
issuedAt- The value of theiatclaim. A time expressed in seconds elapsed since the Unix epoch.- Returns:
thisobject.
-
cti
Set the "cti (7)" claim.- Parameters:
identifier- The value of thecticlaim (CWT ID). The UTF-8 byte sequence of the given string is used as the actual value of the claim.- Returns:
thisobject.
-
cti
Set the "cti (7)" claim.- Parameters:
identifier- The value of thecticlaim (CWT ID).- Returns:
thisobject.
-
nonce
Set the "Nonce (10)" claim.- Parameters:
nonce- The value of theNonceclaim. The UTF-8 byte sequence of the given string is used as the actual value of the claim.- Returns:
thisobject.
-
nonce
Set the "Nonce (10)" claim.- Parameters:
nonce- The value of theNonceclaim.- Returns:
thisobject.
-
ttl
Set the "ttl (65534)" claim.- Parameters:
ttl- The value of thettl(Time to Live) claim. The maximum amount of time, in seconds, that the Status List Token can be cached by a consumer before a fresh copy SHOULD be retrieved.- Returns:
thisobject.- Since:
- 1.21
- See Also:
-
build
Build an instance of theCWTClaimsSetclass.- Returns:
- An instance of the
CWTClaimsSetclass.
-