Class JwtTokenHandler
java.lang.Object
org.forgerock.json.jose.tokenhandler.JwtTokenHandler
- All Implemented Interfaces:
TokenHandler
Token handler for creating tokens using a JWT as the store.
-
Constructor Summary
ConstructorsConstructorDescriptionJwtTokenHandler
(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler) Constructs a new JWT token handler that never expires.JwtTokenHandler
(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler, org.wrensecurity.guava.common.base.Optional<Long> tokenLifeTimeInSeconds) Constructs a new JWT token handler. -
Method Summary
-
Constructor Details
-
JwtTokenHandler
public JwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler) Constructs a new JWT token handler that never expires.- Parameters:
jweAlgorithm
- the JWE algorithm use to construct the key pairjweMethod
- the encryption method to usejweKeyPair
- key pair for the purpose of encryptionjwsAlgorithm
- the JWS algorithm to usejwsHandler
- the signing handler
-
JwtTokenHandler
public JwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler, org.wrensecurity.guava.common.base.Optional<Long> tokenLifeTimeInSeconds) Constructs a new JWT token handler.- Parameters:
jweAlgorithm
- the JWE algorithm use to construct the key pairjweMethod
- the encryption method to usejweKeyPair
- key pair for the purpose of encryptionjwsAlgorithm
- the JWS algorithm to usejwsHandler
- the signing handlertokenLifeTimeInSeconds
- token life time in seconds
-
-
Method Details
-
generate
- Specified by:
generate
in interfaceTokenHandler
- Throws:
TokenHandlerException
-
validate
- Specified by:
validate
in interfaceTokenHandler
- Throws:
TokenHandlerException
-
validateAndExtractState
- Specified by:
validateAndExtractState
in interfaceTokenHandler
- Throws:
TokenHandlerException
-