Class SecretEncryption
- java.lang.Object
-
- io.micronaut.security.token.jwt.encryption.AbstractEncryptionConfiguration
-
- io.micronaut.security.token.jwt.encryption.secret.SecretEncryption
-
- All Implemented Interfaces:
EncryptionConfiguration
public class SecretEncryption extends AbstractEncryptionConfiguration
Secret encryption configuration.- Since:
- 1.0
- Author:
- Sergio del Amo
-
-
Field Summary
-
Fields inherited from class io.micronaut.security.token.jwt.encryption.AbstractEncryptionConfiguration
algorithm, method
-
-
Constructor Summary
Constructors Constructor Description SecretEncryption(SecretEncryptionConfiguration secretEncryptionConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.nimbusds.jose.JWEDecrypterbuildDecrypter()Build the appropriate decrypter.protected com.nimbusds.jose.JWEEncrypterbuildEncrypter()Build the appropriate encrypter.java.lang.StringgetSecret()voidsetSecret(java.lang.String secret)Sets secret byte[] with a string with UTF_8 charset.java.lang.StringsupportedAlgorithmsMessage()booleansupports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)Whether this encryption configuration supports this algorithm and encryption method.-
Methods inherited from class io.micronaut.security.token.jwt.encryption.AbstractEncryptionConfiguration
decrypt, encrypt, getAlgorithm, getMethod, setAlgorithm, setMethod
-
-
-
-
Constructor Detail
-
SecretEncryption
public SecretEncryption(SecretEncryptionConfiguration secretEncryptionConfiguration)
- Parameters:
secretEncryptionConfiguration- Instance ofSecretEncryptionConfiguration
-
-
Method Detail
-
supports
public boolean supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)Description copied from interface:EncryptionConfigurationWhether this encryption configuration supports this algorithm and encryption method.- Parameters:
algorithm- the encryption algorithmmethod- the encryption method- Returns:
- whether this encryption configuration supports this algorithm and encryption method
-
supportedAlgorithmsMessage
public java.lang.String supportedAlgorithmsMessage()
- Returns:
- message explaining the supported algorithms
-
buildEncrypter
protected com.nimbusds.jose.JWEEncrypter buildEncrypter() throws com.nimbusds.jose.KeyLengthExceptionDescription copied from class:AbstractEncryptionConfigurationBuild the appropriate encrypter.- Specified by:
buildEncrypterin classAbstractEncryptionConfiguration- Returns:
- the appropriate encrypter
- Throws:
com.nimbusds.jose.KeyLengthException
-
buildDecrypter
protected com.nimbusds.jose.JWEDecrypter buildDecrypter() throws com.nimbusds.jose.KeyLengthExceptionDescription copied from class:AbstractEncryptionConfigurationBuild the appropriate decrypter.- Specified by:
buildDecrypterin classAbstractEncryptionConfiguration- Returns:
- the appropriate decrypter
- Throws:
com.nimbusds.jose.KeyLengthException
-
getSecret
public java.lang.String getSecret()
- Returns:
- a string build the secret byte[] and UTF_8 charset
-
setSecret
public void setSecret(java.lang.String secret)
Sets secret byte[] with a string with UTF_8 charset.- Parameters:
secret- UTF_8 string
-
-