JWTBuilder

JWTBuilder provides an interface to generate a JWT (JSON Web Token).

The JWTBuilder is accessed using EbaseSystem#getSecurityManager().

JWTBuilder Properties

A128CBC_HS256 JWE algorithm name for A128CBC-HS256
A128GCM JWE algorithm name for A128GCM
A192CBC_HS384 JWE algorithm name for A192CBC-HS384
A192GCM JWE algorithm name for A192GCM
A256CBC_HS512 JWE algorithm name for A256CBC-HS512
A256GCM JWE algorithm name for A256GCM

JWTBuilder Functions

addClaim JWTBuilder.addClaim( name , value ) Add a new claim to the JWT.
setAudience JWTBuilder.setAudience( audience ) Sets RFC 7519 standard registered claim aud - Audience.
contentType JWTBuilder.contentType( cty ) Set the content type header to the JWT Header.
setExpiry JWTBuilder.setExpiry( expiry ) Sets RFC 7519 standard registered claim exp - Expiration.
setExpiryMillies JWTBuilder.setExpiryMillies( expiry ) Sets RFC 7519 standard registered claim exp - Expiration.
generateDirectJWE JWTBuilder.generateDirectJWE( algorithm , secret ) Generates Direct Encryption JSON Web Encryption (JWE) token to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
generateJWSToken JWTBuilder.generateJWSToken( ) Serializes the JSON Web Token (JWS) to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
generateJWTToken JWTBuilder.generateJWTToken( ) Serializes the JSON Web Token (JWT) to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
setId JWTBuilder.setId( id ) Sets RFC 7519 standard registered claim jti - JWT ID.
setIssuedAt JWTBuilder.setIssuedAt( date ) Sets RFC 7519 standard registered claim iat - Issued At.
setIssuer JWTBuilder.setIssuer( issuer ) Sets RFC 7519 standard registered claim iss - Issuer.
keyId JWTBuilder.keyId( kid ) Set the key id header to the JWT Header.
setNotBefore JWTBuilder.setNotBefore( date ) Sets RFC 7519 standard registered claim nbf - Not Before.
setPayload JWTBuilder.setPayload( payload ) Sets the JWT's payload to be a plaintext (non-JSON) string.
setHeaderParam JWTBuilder.setHeaderParam( name , value ) Add a new header to the JWT.
signWithEC JWTBuilder.signWithEC( algorithm , privateKey )
signWithHMAC JWTBuilder.signWithHMAC( algorithm , secret )
signWithRSA JWTBuilder.signWithRSA( algorithm , privateKey )
setSubject JWTBuilder.setSubject( subject ) Sets RFC 7519 standard registered claim sub - Subject.