Package org.pac4j.jwt.config.encryption
Class SecretEncryptionConfiguration
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
org.pac4j.jwt.config.encryption.SecretEncryptionConfiguration
- All Implemented Interfaces:
EncryptionConfiguration
Secret encryption configuration.
- Since:
- 1.9.2
- Author:
- Jerome Leleu
-
Field Summary
Fields inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
algorithm, method -
Constructor Summary
ConstructorsConstructorDescriptionSecretEncryptionConfiguration(byte[] secret) SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) SecretEncryptionConfiguration(String secret) SecretEncryptionConfiguration(String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.nimbusds.jose.JWEDecrypterBuild the appropriate decrypter.protected com.nimbusds.jose.JWEEncrypterBuild the appropriate encrypter.byte[]protected voidinternalInit(boolean forceReinit) voidvoidsetSecretBase64(String secret) voidsetSecretBytes(byte[] secretBytes) booleansupports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Whether this encryption configuration supports this algorithm and encryption method.toString()Methods inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
decrypt, encrypt, getAlgorithm, getMethod, setAlgorithm, setMethodMethods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
-
Constructor Details
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration() -
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret) -
SecretEncryptionConfiguration
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) -
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
-
Method Details
-
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
-
internalInit
protected void internalInit(boolean forceReinit) - Specified by:
internalInitin classorg.pac4j.core.util.InitializableObject
-
buildEncrypter
protected com.nimbusds.jose.JWEEncrypter buildEncrypter()Description copied from class:AbstractEncryptionConfigurationBuild the appropriate encrypter.- Specified by:
buildEncrypterin classAbstractEncryptionConfiguration- Returns:
- the appropriate encrypter
-
buildDecrypter
protected com.nimbusds.jose.JWEDecrypter buildDecrypter()Description copied from class:AbstractEncryptionConfigurationBuild the appropriate decrypter.- Specified by:
buildDecrypterin classAbstractEncryptionConfiguration- Returns:
- the appropriate decrypter
-
getSecret
-
setSecret
-
getSecretBytes
public byte[] getSecretBytes() -
setSecretBytes
public void setSecretBytes(byte[] secretBytes) -
getSecretBase64
-
setSecretBase64
-
toString
-