Package org.pac4j.jwt.config.encryption
Class AbstractEncryptionConfiguration
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
- All Implemented Interfaces:
EncryptionConfiguration
- Direct Known Subclasses:
ECEncryptionConfiguration,RSAEncryptionConfiguration,SecretEncryptionConfiguration
public abstract class AbstractEncryptionConfiguration
extends org.pac4j.core.util.InitializableObject
implements EncryptionConfiguration
Abstract encryption configuration.
- Since:
- 1.9.2
- Author:
- Jerome Leleu
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract com.nimbusds.jose.JWEDecrypterBuild the appropriate decrypter.protected abstract com.nimbusds.jose.JWEEncrypterBuild the appropriate encrypter.voiddecrypt(com.nimbusds.jwt.EncryptedJWT encryptedJWT) Decrypt an encrypted JWT.encrypt(com.nimbusds.jwt.JWT jwt) Encrypt a JWT.com.nimbusds.jose.JWEAlgorithmcom.nimbusds.jose.EncryptionMethodvoidsetAlgorithm(com.nimbusds.jose.JWEAlgorithm algorithm) voidsetMethod(com.nimbusds.jose.EncryptionMethod method) Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, internalInit, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitializeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pac4j.jwt.config.encryption.EncryptionConfiguration
supports
-
Field Details
-
algorithm
protected com.nimbusds.jose.JWEAlgorithm algorithm -
method
protected com.nimbusds.jose.EncryptionMethod method
-
-
Constructor Details
-
AbstractEncryptionConfiguration
public AbstractEncryptionConfiguration()
-
-
Method Details
-
encrypt
Description copied from interface:EncryptionConfigurationEncrypt a JWT.- Specified by:
encryptin interfaceEncryptionConfiguration- Parameters:
jwt- the JWT- Returns:
- the encrypted JWT
-
buildEncrypter
protected abstract com.nimbusds.jose.JWEEncrypter buildEncrypter()Build the appropriate encrypter.- Returns:
- the appropriate encrypter
-
decrypt
public void decrypt(com.nimbusds.jwt.EncryptedJWT encryptedJWT) throws com.nimbusds.jose.JOSEException Description copied from interface:EncryptionConfigurationDecrypt an encrypted JWT.- Specified by:
decryptin interfaceEncryptionConfiguration- Parameters:
encryptedJWT- the encrypted JWT- Throws:
com.nimbusds.jose.JOSEException- exception when decrypting the JWT
-
buildDecrypter
protected abstract com.nimbusds.jose.JWEDecrypter buildDecrypter()Build the appropriate decrypter.- Returns:
- the appropriate decrypter
-
getAlgorithm
public com.nimbusds.jose.JWEAlgorithm getAlgorithm() -
setAlgorithm
public void setAlgorithm(com.nimbusds.jose.JWEAlgorithm algorithm) -
getMethod
public com.nimbusds.jose.EncryptionMethod getMethod() -
setMethod
public void setMethod(com.nimbusds.jose.EncryptionMethod method)
-