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.PreferSecretsJwtTokenHandlerinstead.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 Stringgenerate(JsonValue state)Deprecated.Generates a new token using the state.voidvalidate(String snapshotToken)Deprecated.Validates the passed token.JsonValuevalidateAndExtractState(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: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
public void validate(String snapshotToken) throws TokenHandlerException
Deprecated.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
public JsonValue validateAndExtractState(String snapshotToken) throws TokenHandlerException
Deprecated.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
-
-