Class SecretsJwtTokenHandler
- java.lang.Object
- 
- org.forgerock.json.jose.tokenhandler.SecretsJwtTokenHandler
 
- 
- All Implemented Interfaces:
- TokenHandler
 
 public final class SecretsJwtTokenHandler extends Object implements TokenHandler Token handler for creating tokens using a JWT as the store.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSecretsJwtTokenHandler.BuilderBuilder pattern object for configuring aSecretsJwtTokenHandler.
 - 
Constructor SummaryConstructors Constructor Description 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.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SecretsJwtTokenHandler.Builderbuilder()Creates a newSecretsJwtTokenHandler.Builderobject to configure aSecretsJwtTokenHandlerinstance.Stringgenerate(JsonValue state)Generates a new token using the state.voidvalidate(String snapshotToken)Validates the passed token.JsonValuevalidateAndExtractState(String snapshotToken)Validates and parses the token, extracting any encapsulated state.
 
- 
- 
- 
Constructor Detail- 
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 pair
- jweMethod- the encryption method to use
- jwsAlgorithm- the JWS algorithm to use
- tokenLifeTimeInSeconds- token life time in seconds
- jweKeyPair- key pair for the purpose of encryption
- manager- manager used to obtain secrets
- signingKeyPurpose- purpose of the signing secret
- verificationKeyPurpose- purpose of the signature verification secret
- clock- clock to handle expiration timeouts
 
 
- 
 - 
Method Detail- 
builderpublic static SecretsJwtTokenHandler.Builder builder() Creates a newSecretsJwtTokenHandler.Builderobject to configure aSecretsJwtTokenHandlerinstance.- Returns:
- a fresh builder instance.
 
 - 
generatepublic String generate(JsonValue state) throws TokenHandlerException Description copied from interface:TokenHandlerGenerates a new token using the state.- Specified by:
- generatein interface- TokenHandler
- Parameters:
- state- the state
- Returns:
- token
- Throws:
- TokenHandlerException- on failure to generate token
 
 - 
validatepublic void validate(String snapshotToken) throws TokenHandlerException Description copied from interface:TokenHandlerValidates the passed token.- Specified by:
- validatein interface- TokenHandler
- Parameters:
- snapshotToken- the token to be validated
- Throws:
- InvalidTokenException- on invalid token
- ExpiredTokenException- on expired token
- TokenHandlerException- on other failure to validate token
 
 - 
validateAndExtractStatepublic JsonValue validateAndExtractState(String snapshotToken) throws TokenHandlerException Description copied from interface:TokenHandlerValidates and parses the token, extracting any encapsulated state.- Specified by:
- validateAndExtractStatein interface- TokenHandler
- Parameters:
- snapshotToken- the token to be validated and parsed
- Returns:
- the state
- Throws:
- InvalidTokenException- on invalid token
- ExpiredTokenException- on expired token
- TokenHandlerException- on other failure to validate or extract token
 
 
- 
 
-