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
ConstructorDescriptionConstructor for SecretEncryptionConfiguration.SecretEncryptionConfiguration
(byte[] secret) Constructor for SecretEncryptionConfiguration.SecretEncryptionConfiguration
(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Constructor for SecretEncryptionConfiguration.SecretEncryptionConfiguration
(String secret) Constructor for SecretEncryptionConfiguration.SecretEncryptionConfiguration
(String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Constructor for SecretEncryptionConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.nimbusds.jose.JWEDecrypter
Build the appropriate decrypter.protected com.nimbusds.jose.JWEEncrypter
Build the appropriate encrypter.Getter for the fieldsecret
.getSecretBase64.byte[]
getSecretBytes.protected void
internalInit
(boolean forceReinit) void
Setter for the fieldsecret
.void
setSecretBase64
(String secret) setSecretBase64.void
setSecretBytes
(byte[] secretBytes) setSecretBytes.boolean
supports
(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Whether this encryption configuration supports this algorithm and encryption method.Methods inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
decrypt, encrypt
Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString
-
Constructor Details
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration()Constructor for SecretEncryptionConfiguration.
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret) Constructor for SecretEncryptionConfiguration.
- Parameters:
secret
- an array ofinvalid reference
byte
-
SecretEncryptionConfiguration
Constructor for SecretEncryptionConfiguration.
- Parameters:
secret
- aString
object
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Constructor for SecretEncryptionConfiguration.
- Parameters:
secret
- an array ofinvalid reference
byte
algorithm
- aJWEAlgorithm
objectmethod
- aEncryptionMethod
object
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Constructor for SecretEncryptionConfiguration.
- Parameters:
secret
- aString
objectalgorithm
- aJWEAlgorithm
objectmethod
- aEncryptionMethod
object
-
-
Method Details
-
supports
public boolean supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method) Whether 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:
internalInit
in classorg.pac4j.core.util.InitializableObject
-
buildEncrypter
protected com.nimbusds.jose.JWEEncrypter buildEncrypter()Build the appropriate encrypter.- Specified by:
buildEncrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate encrypter
-
buildDecrypter
protected com.nimbusds.jose.JWEDecrypter buildDecrypter()Build the appropriate decrypter.- Specified by:
buildDecrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate decrypter
-
getSecret
Getter for the field
secret
.- Returns:
- a
String
object
-
setSecret
Setter for the field
secret
.- Parameters:
secret
- aString
object
-
getSecretBytes
public byte[] getSecretBytes()getSecretBytes.
- Returns:
- an array of
invalid reference
byte
-
setSecretBytes
public void setSecretBytes(byte[] secretBytes) setSecretBytes.
- Parameters:
secretBytes
- an array ofinvalid reference
byte
-
getSecretBase64
getSecretBase64.
- Returns:
- a
String
object
-
setSecretBase64
setSecretBase64.
- Parameters:
secret
- aString
object
-