Class AbstractEncryptionConfiguration
java.lang.Object
io.micronaut.security.token.jwt.encryption.AbstractEncryptionConfiguration
- All Implemented Interfaces:
EncryptionConfiguration
- Direct Known Subclasses:
ECEncryption,RSAEncryption,SecretEncryption
public abstract class AbstractEncryptionConfiguration
extends Object
implements EncryptionConfiguration
Abstract encryption configuration.
- Since:
- 1.0
- Author:
- Sergio del Amo
-
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.JWEAlgorithmalgorithm Getter.com.nimbusds.jose.EncryptionMethodmethod Getter.voidsetAlgorithm(com.nimbusds.jose.JWEAlgorithm algorithm) algorithm Setter.voidsetMethod(com.nimbusds.jose.EncryptionMethod method) method Setter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.security.token.jwt.encryption.EncryptionConfiguration
supportedAlgorithmsMessage, 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
public String encrypt(com.nimbusds.jwt.JWT jwt) throws com.nimbusds.jose.JOSEException, ParseException Description copied from interface:EncryptionConfigurationEncrypt a JWT.- Specified by:
encryptin interfaceEncryptionConfiguration- Parameters:
jwt- the JWT- Returns:
- the encrypted JWT
- Throws:
com.nimbusds.jose.JOSEException- exception when encrypting JWTParseException- exception when encrypting JWT
-
buildEncrypter
protected abstract com.nimbusds.jose.JWEEncrypter buildEncrypter() throws com.nimbusds.jose.JOSEExceptionBuild the appropriate encrypter.- Returns:
- the appropriate encrypter
- Throws:
com.nimbusds.jose.JOSEException- could be thrown while building encrypter if configuration is invalid
-
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() throws com.nimbusds.jose.JOSEExceptionBuild the appropriate decrypter.- Returns:
- the appropriate decrypter
- Throws:
com.nimbusds.jose.JOSEException- could be thrown while building decrypter if configuration is invalid
-
getAlgorithm
public com.nimbusds.jose.JWEAlgorithm getAlgorithm()algorithm Getter.- Returns:
- Instance of
JWEAlgorithm
-
setAlgorithm
public void setAlgorithm(com.nimbusds.jose.JWEAlgorithm algorithm) algorithm Setter.- Parameters:
algorithm- Instance ofJWEAlgorithm
-
getMethod
public com.nimbusds.jose.EncryptionMethod getMethod()method Getter.- Returns:
- Instance of
EncryptionMethod
-
setMethod
public void setMethod(com.nimbusds.jose.EncryptionMethod method) method Setter.- Parameters:
method- Instance ofEncryptionMethod
-