Class ECEncryptionConfiguration

java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.jwt.config.encryption.AbstractEncryptionConfiguration
org.pac4j.jwt.config.encryption.ECEncryptionConfiguration
All Implemented Interfaces:
EncryptionConfiguration

public class ECEncryptionConfiguration extends AbstractEncryptionConfiguration
Elliptic curve 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
    Constructor for ECEncryptionConfiguration.
    Constructor for ECEncryptionConfiguration.
    ECEncryptionConfiguration(KeyPair keyPair, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)
    Constructor for ECEncryptionConfiguration.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.nimbusds.jose.JWEDecrypter
    Build the appropriate decrypter.
    protected com.nimbusds.jose.JWEEncrypter
    Build the appropriate encrypter.
    protected void
    internalInit(boolean forceReinit)
    void
    setKeyPair.
    void
    setKeysFromJwk.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ECEncryptionConfiguration

      public ECEncryptionConfiguration()

      Constructor for ECEncryptionConfiguration.

    • ECEncryptionConfiguration

      public ECEncryptionConfiguration(KeyPair keyPair)

      Constructor for ECEncryptionConfiguration.

      Parameters:
      keyPair - a KeyPair object
    • ECEncryptionConfiguration

      public ECEncryptionConfiguration(KeyPair keyPair, com.nimbusds.jose.JWEAlgorithm algorithm, com.nimbusds.jose.EncryptionMethod method)

      Constructor for ECEncryptionConfiguration.

      Parameters:
      keyPair - a KeyPair 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
    • setKeyPair

      public void setKeyPair(KeyPair keyPair)

      setKeyPair.

      Parameters:
      keyPair - a KeyPair object
    • setKeysFromJwk

      public void setKeysFromJwk(String json)

      setKeysFromJwk.

      Parameters:
      json - a String object