public class JWTBuilder extends Object
Constructor and Description |
---|
JWTBuilder() |
Modifier and Type | Method and Description |
---|---|
String |
build()
Build a signed JWT from the added fields
If issuedAt not specified default to current time.
|
JWTBuilder |
setAudience(String value) |
JWTBuilder |
setExpiration(long value) |
JWTBuilder |
setIssuedAt(long value) |
JWTBuilder |
setSigner(Signer value) |
public String build() throws JSONException, SignatureException, IllegalArgumentException
JSONException
- when building the JSON part JWT is failingSignatureException
- when the signature has failedIllegalArgumentException
- when fields are not correctpublic JWTBuilder setAudience(String value)
value
- the audience to of the JWT (usually projectID)public JWTBuilder setExpiration(long value)
value
- the UNIX timestamp in seconds of the JWT expirationpublic JWTBuilder setIssuedAt(long value)
value
- the UNIX timestamp in seconds of the JWT creationpublic JWTBuilder setSigner(Signer value)
value
- the signer containing the private key information