Class JwtTokenHandler
- java.lang.Object
-
- org.forgerock.json.jose.tokenhandler.JwtTokenHandler
-
- All Implemented Interfaces:
TokenHandler
@Deprecated public final class JwtTokenHandler extends Object implements TokenHandler
Deprecated.PreferSecretsJwtTokenHandler
instead.Token handler for creating tokens using a JWT as the store.
-
-
Constructor Summary
Constructors Constructor Description JwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler)
Deprecated.Constructs a new JWT token handler that never expires.JwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler, Optional<Long> tokenLifeTimeInSeconds, int tokenStatePaddingLength)
Deprecated.Constructs a new JWT token handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
generate(JsonValue state)
Deprecated.Generates a new token using the state.void
validate(String snapshotToken)
Deprecated.Validates the passed token.JsonValue
validateAndExtractState(String snapshotToken)
Deprecated.Validates and parses the token, extracting any encapsulated state.
-
-
-
Constructor Detail
-
JwtTokenHandler
public JwtTokenHandler(JweAlgorithm jweAlgorithm, EncryptionMethod jweMethod, KeyPair jweKeyPair, JwsAlgorithm jwsAlgorithm, SigningHandler jwsHandler)
Deprecated.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, Optional<Long> tokenLifeTimeInSeconds, int tokenStatePaddingLength)
Deprecated.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 secondstokenStatePaddingLength
- desired length of state claim after padding
-
-
Method Detail
-
generate
public String generate(JsonValue state) throws TokenHandlerException
Deprecated.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
public void validate(String snapshotToken) throws TokenHandlerException
Deprecated.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
public JsonValue validateAndExtractState(String snapshotToken) throws TokenHandlerException
Deprecated.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
-
-