java.lang.Object
io.helidon.security.jwt.JwtHeaders.Builder
- All Implemented Interfaces:
- Builder<JwtHeaders.Builder,,- JwtHeaders> - Supplier<JwtHeaders>
- Enclosing class:
- JwtHeaders
public static class JwtHeaders.Builder
extends Object
implements Builder<JwtHeaders.Builder,JwtHeaders> 
Fluent API builder to create JWT Header.
- 
Method SummaryModifier and TypeMethodDescriptionaddHeaderAudience(String audience) Audience identifies the expected recipients of this JWT (optional).addHeaderClaim(String claim, Object value) Add a header claim.The "alg" claim is used to define the signature algorithm.build()Build the instance from this builder.contentType(String contentType) This header claim should only be used when nesting or encrypting JWT.encryption(String encryption) Encryption algorithm to use.headerAudience(List<String> audience) Audience identifies the expected recipients of this JWT (optional).headerIssuer(String issuer) The issuer claim identifies the principal that issued the JWT.headerSubject(String subject) Subject defines the principal this JWT was issued for (e.g.Key id to be used to sign/verify this JWT.Type of this JWT.
- 
Method Details- 
buildDescription copied from interface:BuilderBuild the instance from this builder.- Specified by:
- buildin interface- Builder<JwtHeaders.Builder,- JwtHeaders> 
- Returns:
- instance of the built type
 
- 
addHeaderClaimAdd a header claim.- Parameters:
- claim- name of the claim
- value- claim value, must be of expected type
- Returns:
- updated builder
- Throws:
- IllegalArgumentException- if a known header (such as- iss,- aud) is set to a non-string type
 
- 
algorithmThe "alg" claim is used to define the signature algorithm. Note that this algorithm should be the same as is supported by the JWK used to sign (or verify) the JWT.- Parameters:
- algorithm- algorithm to use,- Jwk.ALG_NONEfor none
- Returns:
- updated builder instance
 
- 
encryptionEncryption algorithm to use.- Parameters:
- encryption- encryption to use
- Returns:
- updated builder
 
- 
contentTypeThis header claim should only be used when nesting or encrypting JWT. See RFC 7519, section 5.2.- Parameters:
- contentType- content type to use, use "JWT" if nested
- Returns:
- updated builder instance
 
- 
keyIdKey id to be used to sign/verify this JWT.- Parameters:
- keyId- key id (pointing to a JWK)
- Returns:
- updated builder instance
 
- 
typeType of this JWT.- Parameters:
- type- type definition (JWT, JWE)
- Returns:
- updated builder instance
 
- 
headerSubjectSubject defines the principal this JWT was issued for (e.g. user id). This configures subject in header claims (usually it is part of payload). See RFC 7519, section 4.1.2.- Parameters:
- subject- subject of this JWt
- Returns:
- updated builder instance
 
- 
headerIssuerThe issuer claim identifies the principal that issued the JWT. This configures issuer in header claims (usually it is part of payload). See RFC 7519, section 4.1.1.- Parameters:
- issuer- issuer name or URL
- Returns:
- updated builder instance
 
- 
addHeaderAudienceAudience identifies the expected recipients of this JWT (optional). Multiple audience may be added. This configures audience in header claims, usually this is defined in payload. See RFC 7519, section 4.1.3.- Parameters:
- audience- audience of this JWT
- Returns:
- updated builder instance
- See Also:
 
- 
headerAudienceAudience identifies the expected recipients of this JWT (optional). Replaces existing configured audiences. This configures audience in header claims, usually this is defined in payload. See RFC 7519, section 4.1.3.- Parameters:
- audience- audience of this JWT
- Returns:
- updated builder instance
 
 
-