java.lang.Object
io.helidon.security.jwt.JwtHeaders
Representation of the header section of a JWT.
 This can be used to partially parse a token to understand what kind of
 processing should be done further, whether 
SignedJwt
 or EncryptedJwt.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classFluent API builder to create JWT Header.
- 
Method SummaryModifier and TypeMethodDescriptionAlgorithm claim.audience()Audience claim.static JwtHeaders.Builderbuilder()Create a new builder for header claims.Content type claim.protected static Stringdecode(String base64, Errors.Collector collector, String description) Encryption algorithm claim.headerClaim(String claim) Get a claim by its name from header.Create a JSON header object.issuer()Issuer claim.keyId()Key id claim.protected static JsonObjectparseJson(String jsonString, Errors.Collector collector, String base64, String description) static JwtHeadersparseToken(String token) Parse a token to retrieve the JWT header.subject()Subject claim.type()Type claim.
- 
Method Details- 
builderCreate a new builder for header claims.- Returns:
- a new builder
 
- 
parseTokenParse a token to retrieve the JWT header. This method only cares about the first section of the token, and ignores the rest (even if not valid). Text before the first dot is considered to be base64 value of the header JSON.- Parameters:
- token- token, expected to be JWT (encrypted or signed)
- Returns:
- header parsed from the token
- Throws:
- JwtException- in case the token is not valid
 
- 
headerJsonCreate a JSON header object.- Returns:
- JsonObject for header
 
- 
headerClaimGet a claim by its name from header.- Parameters:
- claim- name of a claim
- Returns:
- claim value if present
 
- 
algorithmAlgorithm claim.- Returns:
- algorithm or empty if claim is not defined
 
- 
encryptionEncryption algorithm claim.- Returns:
- algorithm or empty if not encrypted
 
- 
contentTypeContent type claim.- Returns:
- content type or empty if claim is not defined
 
- 
keyIdKey id claim.- Returns:
- key id or empty if claim is not defined
 
- 
typeType claim.- Returns:
- type or empty if claim is not defined
 
- 
subjectSubject claim.- Returns:
- subject or empty if claim is not defined
 
- 
issuerIssuer claim.- Returns:
- Issuer or empty if claim is not defined
 
- 
audienceAudience claim.- Returns:
- audience or empty optional if claim is not defined; list would be empty if the audience claim is defined as an empty array
 
- 
decode
- 
parseJsonprotected static JsonObject parseJson(String jsonString, Errors.Collector collector, String base64, String description) 
 
-