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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder pattern object for configuring aSecretsJwtTokenHandler. - 
Constructor Summary
ConstructorsConstructorDescriptionSecretsJwtTokenHandler(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.Builderobject to configure aSecretsJwtTokenHandlerinstance.Generates a new token using the state.voidValidates 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.Builderobject to configure aSecretsJwtTokenHandlerinstance.- Returns:
 - a fresh builder instance.
 
 - 
generate
Description copied from interface:TokenHandlerGenerates a new token using the state.- Specified by:
 generatein interfaceTokenHandler- Parameters:
 state- the state- Returns:
 - token
 - Throws:
 TokenHandlerException- on failure to generate token
 - 
validate
Description copied from interface:TokenHandlerValidates the passed token.- Specified by:
 validatein 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:TokenHandlerValidates and parses the token, extracting any encapsulated state.- Specified by:
 validateAndExtractStatein 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.