Class SecretsJwtTokenHandler
java.lang.Object
org.forgerock.json.jose.tokenhandler.SecretsJwtTokenHandler
- All Implemented Interfaces:
TokenHandler
Token handler for creating tokens using a JWT as the store.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder pattern object for configuring aSecretsJwtTokenHandler
. -
Constructor Summary
ConstructorDescriptionSecretsJwtTokenHandler
(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, JwsAlgorithm jwsAlgorithm, Optional<Long> tokenLifeTimeInSeconds, KeyPair jweKeyPair, SigningManager manager, Purpose<SigningKey> signingKeyPurpose, Purpose<VerificationKey> verificationKeyPurpose, Clock clock) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a newSecretsJwtTokenHandler.Builder
object to configure aSecretsJwtTokenHandler
instance.Generates a new token using the state.void
Validates the passed token.validateAndExtractState
(String snapshotToken) Validates and parses the token, extracting any encapsulated state.
-
Constructor Details
-
SecretsJwtTokenHandler
@Deprecated public SecretsJwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, JwsAlgorithm jwsAlgorithm, Optional<Long> tokenLifeTimeInSeconds, KeyPair jweKeyPair, SigningManager manager, Purpose<SigningKey> signingKeyPurpose, Purpose<VerificationKey> verificationKeyPurpose, Clock clock) Deprecated.Usebuilder()
instead.Constructs a new JWT token handler.- Parameters:
jweAlgorithm
- the JWE algorithm use to construct the key pairjweMethod
- the encryption method to usejwsAlgorithm
- the JWS algorithm to usetokenLifeTimeInSeconds
- token life time in secondsjweKeyPair
- key pair for the purpose of encryptionmanager
- manager used to obtain secretssigningKeyPurpose
- purpose of the signing secretverificationKeyPurpose
- purpose of the signature verification secretclock
- clock to handle expiration timeouts
-
-
Method Details
-
builder
Creates a newSecretsJwtTokenHandler.Builder
object to configure aSecretsJwtTokenHandler
instance.- Returns:
- a fresh builder instance.
-
generate
Description copied from interface:TokenHandler
Generates a new token using the state.- Specified by:
generate
in interfaceTokenHandler
- Parameters:
state
- the state- Returns:
- token
- Throws:
TokenHandlerException
- on failure to generate token
-
validate
Description copied from interface:TokenHandler
Validates the passed token.- Specified by:
validate
in interfaceTokenHandler
- Parameters:
snapshotToken
- the token to be validated- Throws:
InvalidTokenException
- on invalid tokenExpiredTokenException
- on expired tokenTokenHandlerException
- on other failure to validate token
-
validateAndExtractState
Description copied from interface:TokenHandler
Validates and parses the token, extracting any encapsulated state.- Specified by:
validateAndExtractState
in interfaceTokenHandler
- Parameters:
snapshotToken
- the token to be validated and parsed- Returns:
- the state
- Throws:
InvalidTokenException
- on invalid tokenExpiredTokenException
- on expired tokenTokenHandlerException
- on other failure to validate or extract token
-
builder()
instead.