10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.service.JwtService Interface Reference

Detailed Description

Interface for providing functionality for handling JWTs.

Inheritance diagram for tenduke.sdk.core.service.JwtService:
tenduke.sdk.core.service.JwtMetadataParser tenduke.sdk.core.service.impl.DefaultJwtService

Public Member Functions

String signingKeyId ()
 Returns the key id for the private key that is used to sign JWT's.
 
String verificationKeyId ()
 Returns the key id for the public key that is used to validate JWT's.
 
String buildAndSign (Map< String, Object > claims)
 Builds and signs a JWT.
 
String buildAndSign (String data)
 Builds and signs a JWT.
 
JwtToken parse (String jwt)
 Parses a String to a JwtToken and validates the signature.
 
JwtToken parseNoVerify (String jwt)
 Parses a String to a JwtToken and skips signature verification.
 
JwtService withTypHeaderValidationDisabled ()
 Disables JWT typ header claim validation.
 
- Public Member Functions inherited from tenduke.sdk.core.service.JwtMetadataParser
String readKeyIdHeader (String jwt)
 Reads a key id from the JWT header.
 

Additional Inherited Members

- Public Attributes inherited from tenduke.sdk.core.service.JwtMetadataParser
String HEADER_SIGNATURE_ALGORITHM = "alg"
 Header claim name for signature algorithm.
 
String HEADER_KEY_ID = "kid"
 Header claim name for key id.
 
String HEADER_TYPE = "typ"
 Header claim name for token type.
 
String TOKEN_TYPE_JWT = "JWT"
 Header claim type that denotes a JWT.
 
String SIGNATURE_ALGORITHM_RSA_SHA = "RS256"
 Header value for alg claim, denotes RSA-SHA algorithm used for JWT signatures.
 

Member Function Documentation

◆ buildAndSign() [1/2]

String tenduke.sdk.core.service.JwtService.buildAndSign ( Map< String, Object > claims)

Builds and signs a JWT.

Parameters
claimsA map with key value pairs to use as JWT body JSON data definition.
Returns
A signed JWT with the map data as its body.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ buildAndSign() [2/2]

String tenduke.sdk.core.service.JwtService.buildAndSign ( String data)

Builds and signs a JWT.

Parameters
dataData to use as such for the JWT body.
Returns
A signed JWT with the data as its body.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ parse()

JwtToken tenduke.sdk.core.service.JwtService.parse ( String jwt)

Parses a String to a JwtToken and validates the signature.

Parameters
jwtThe String to parse and validate.
Returns
A JwtToken or throws an error if parsing fails.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ parseNoVerify()

JwtToken tenduke.sdk.core.service.JwtService.parseNoVerify ( String jwt)

Parses a String to a JwtToken and skips signature verification.

Parameters
jwtThe String to parse and validate.
Returns
A JwtToken parsed from given JWT string.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ signingKeyId()

String tenduke.sdk.core.service.JwtService.signingKeyId ( )

Returns the key id for the private key that is used to sign JWT's.

Returns
key id for the private key that is used to sign JWT's.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ verificationKeyId()

String tenduke.sdk.core.service.JwtService.verificationKeyId ( )

Returns the key id for the public key that is used to validate JWT's.

Returns
key id for the public key that is used to validate JWT's.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.

◆ withTypHeaderValidationDisabled()

JwtService tenduke.sdk.core.service.JwtService.withTypHeaderValidationDisabled ( )

Disables JWT typ header claim validation.

Returns
this instance.

Implemented in tenduke.sdk.core.service.impl.DefaultJwtService.


The documentation for this interface was generated from the following file: