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
  • Constructor Details

    • SecretEncryptionConfiguration

      public SecretEncryptionConfiguration()

      Constructor for SecretEncryptionConfiguration.

    • SecretEncryptionConfiguration

      public SecretEncryptionConfiguration(byte[] secret)

      Constructor for SecretEncryptionConfiguration.

      Parameters:
      secret - an array of
      invalid reference
      byte
      objects
    • SecretEncryptionConfiguration

      public SecretEncryptionConfiguration(String secret)

      Constructor for SecretEncryptionConfiguration.

      Parameters:
      secret - a String object
    • SecretEncryptionConfiguration

      public SecretEncryptionConfiguration(byte[] secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)

      Constructor for SecretEncryptionConfiguration.

      Parameters:
      secret - an array of
      invalid reference
      byte
      objects
      algorithm - a JWEAlgorithm object
      method - a EncryptionMethod object
    • SecretEncryptionConfiguration

      public SecretEncryptionConfiguration(String secret, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)

      Constructor for SecretEncryptionConfiguration.

      Parameters:
      secret - a String object
      algorithm - a JWEAlgorithm object
      method - a EncryptionMethod 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 algorithm
      method - the encryption method
      Returns:
      whether this encryption configuration supports this algorithm and encryption method
    • internalInit

      protected void internalInit(boolean forceReinit)
      Specified by:
      internalInit in class org.pac4j.core.util.InitializableObject
    • buildEncrypter

      protected com.nimbusds.jose.JWEEncrypter buildEncrypter()
      Build the appropriate encrypter.
      Specified by:
      buildEncrypter in class AbstractEncryptionConfiguration
      Returns:
      the appropriate encrypter
    • buildDecrypter

      protected com.nimbusds.jose.JWEDecrypter buildDecrypter()
      Build the appropriate decrypter.
      Specified by:
      buildDecrypter in class AbstractEncryptionConfiguration
      Returns:
      the appropriate decrypter
    • getSecret

      public String getSecret()

      Getter for the field secret.

      Returns:
      a String object
    • setSecret

      public void setSecret(String secret)

      Setter for the field secret.

      Parameters:
      secret - a String object
    • getSecretBytes

      public byte[] getSecretBytes()

      getSecretBytes.

      Returns:
      an array of
      invalid reference
      byte
      objects
    • setSecretBytes

      public void setSecretBytes(byte[] secretBytes)

      setSecretBytes.

      Parameters:
      secretBytes - an array of
      invalid reference
      byte
      objects
    • getSecretBase64

      public String getSecretBase64()

      getSecretBase64.

      Returns:
      a String object
    • setSecretBase64

      public void setSecretBase64(String secret)

      setSecretBase64.

      Parameters:
      secret - a String object