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
public class SecretEncryptionConfiguration extends AbstractEncryptionConfiguration
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
Constructors Constructor Description SecretEncryptionConfiguration()
SecretEncryptionConfiguration(byte[] secret)
SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
SecretEncryptionConfiguration(java.lang.String secret)
SecretEncryptionConfiguration(java.lang.String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.nimbusds.jose.JWEDecrypter
buildDecrypter()
Build the appropriate decrypter.protected com.nimbusds.jose.JWEEncrypter
buildEncrypter()
Build the appropriate encrypter.java.lang.String
getSecret()
java.lang.String
getSecretBase64()
byte[]
getSecretBytes()
protected void
internalInit()
void
setSecret(java.lang.String secret)
void
setSecretBase64(java.lang.String secret)
void
setSecretBytes(byte[] secretBytes)
boolean
supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
Whether this encryption configuration supports this algorithm and encryption method.java.lang.String
toString()
-
Methods inherited from class org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
decrypt, encrypt, getAlgorithm, getMethod, setAlgorithm, setMethod
-
-
-
-
Constructor Detail
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration()
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret)
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(java.lang.String secret)
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
SecretEncryptionConfiguration
public SecretEncryptionConfiguration(java.lang.String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
-
-
Method Detail
-
supports
public boolean supports(com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
Description copied from interface:EncryptionConfiguration
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()
- Specified by:
internalInit
in classorg.pac4j.core.util.InitializableObject
-
buildEncrypter
protected com.nimbusds.jose.JWEEncrypter buildEncrypter()
Description copied from class:AbstractEncryptionConfiguration
Build the appropriate encrypter.- Specified by:
buildEncrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate encrypter
-
buildDecrypter
protected com.nimbusds.jose.JWEDecrypter buildDecrypter()
Description copied from class:AbstractEncryptionConfiguration
Build the appropriate decrypter.- Specified by:
buildDecrypter
in classAbstractEncryptionConfiguration
- Returns:
- the appropriate decrypter
-
getSecret
public java.lang.String getSecret()
-
setSecret
public void setSecret(java.lang.String secret)
-
getSecretBytes
public byte[] getSecretBytes()
-
setSecretBytes
public void setSecretBytes(byte[] secretBytes)
-
getSecretBase64
public java.lang.String getSecretBase64()
-
setSecretBase64
public void setSecretBase64(java.lang.String secret)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-