Class FallbackJwtCryptographyHandler
java.lang.Object
org.forgerock.jaspi.modules.session.jwt.FallbackJwtCryptographyHandler
- All Implemented Interfaces:
JwtCryptographyHandler
A cryptography handler that tries multiple
JwtCryptographyHandlers in turn for decryption. This is useful
when transitioning from one cryptography implementation to another, such as from
KeyStoreJwtCryptographyHandler to AuthenticatedEncryptionCryptographyHandler.-
Constructor Summary
ConstructorsConstructorDescriptionFallbackJwtCryptographyHandler(JwtCryptographyHandler preferredHandler, JwtCryptographyHandler fallbackHandler) Initializes the handler with the given preferred and fallback handlers. -
Method Summary
Modifier and TypeMethodDescriptionbuildJwt(JwtBuilderFactory jwtBuilderFactory, JwtClaimsSet claimsSet) Builds a JWT with the given claims set.voidDeprecated.decryptAndVerify(JwtBuilderFactory jwtBuilderFactory, String jwt) Decrypts and verifies that the JWT is authentic in a single step.voidinitialize(Map<String, Object> options) Initialise the handler.jwe(JwtBuilderFactory jwtbuilder) Deprecated.sign(EncryptedJwtBuilder jwtbuilder) Deprecated.booleanDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.forgerock.jaspi.modules.session.jwt.JwtCryptographyHandler
buildJwtAsync
-
Constructor Details
-
FallbackJwtCryptographyHandler
public FallbackJwtCryptographyHandler(JwtCryptographyHandler preferredHandler, JwtCryptographyHandler fallbackHandler) Initializes the handler with the given preferred and fallback handlers.- Parameters:
preferredHandler- the preferred cryptography handler.fallbackHandler- the fallback cryptography handler.
-
-
Method Details
-
initialize
Description copied from interface:JwtCryptographyHandlerInitialise the handler.- Specified by:
initializein interfaceJwtCryptographyHandler- Parameters:
options- The options to be used.- Throws:
AuthenticationException- If the options are invalid.
-
verify
Deprecated.Description copied from interface:JwtCryptographyHandlerVerify the JWT.- Specified by:
verifyin interfaceJwtCryptographyHandler- Parameters:
jwt- The JWT.- Returns:
- true if the JWT is valid.
-
decrypt
Deprecated.Description copied from interface:JwtCryptographyHandlerDecrypt the JWT.- Specified by:
decryptin interfaceJwtCryptographyHandler- Parameters:
jwt- The JWT.
-
jwe
Deprecated.Description copied from interface:JwtCryptographyHandlerApply encryption to the JWT.- Specified by:
jwein interfaceJwtCryptographyHandler- Parameters:
jwtbuilder- The JWT builder.- Returns:
- The JWT builder after applying encryption.
-
sign
Deprecated.Description copied from interface:JwtCryptographyHandlerSign the JWT.- Specified by:
signin interfaceJwtCryptographyHandler- Parameters:
jwtbuilder- The JWT builder.- Returns:
- The JWT builder after signing.
-
buildJwt
Description copied from interface:JwtCryptographyHandlerBuilds a JWT with the given claims set. The resulting JWT will be both encrypted and authenticated, either through direct authenticated encryption or a combination of encryption and signing.- Specified by:
buildJwtin interfaceJwtCryptographyHandler- Parameters:
jwtBuilderFactory- the JWT builder factory.claimsSet- the claims to add to the JWT.- Returns:
- the JWT in Compact Serialization form.
-
decryptAndVerify
Description copied from interface:JwtCryptographyHandlerDecrypts and verifies that the JWT is authentic in a single step.- Specified by:
decryptAndVerifyin interfaceJwtCryptographyHandler- Parameters:
jwtBuilderFactory- The JWT builder factory.jwt- the JWT to decrypt and verify.- Returns:
- the decrypted and verified JWT.
-