java.lang.Object
io.inverno.mod.security.jose.internal.jwe.GenericJWEService
All Implemented Interfaces:
JOSEObjectService, JWEService

public class GenericJWEService extends Object implements JWEService

Generic JWEService implementation.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • GenericJWEService

      public GenericJWEService(com.fasterxml.jackson.databind.ObjectMapper mapper, io.inverno.mod.security.jose.internal.converter.GenericDataConversionService dataConversionService, JWKService jwkService)

      Creates a generic JWE service.

      Parameters:
      mapper - an object mapper
      dataConversionService - a data conversion service
      jwkService - a JWK service
  • Method Details

    • init

      public void init()

      Initializes the JWE service.

    • setJWEZips

      public void setJWEZips(List<JWEZip> zips)

      Sets the JWE compression algorithm implementations.

      Parameters:
      zips - a set of JWE compression algorithm implementations
    • builder

      public <T> JWEBuilder<T,?,?> builder(Type type, org.reactivestreams.Publisher<? extends JWK> keys)
      Description copied from interface: JOSEObjectService

      Returns a new JOSE object builder with the specified payload type and using the specified keys.

      The returned builder will use the specified keys to secure the JOSE object, the first succeeding key will be retained and remaining keys will be ignored. It will fail if no suitable key have been specified or if they are not consistent with the JOSE header.

      Specified by:
      builder in interface JOSEObjectService
      Specified by:
      builder in interface JWEService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to secure the JOSE object
      Returns:
      a new JOSE object builder
    • reader

      public <T> JWEReader<T,?> reader(Type type, org.reactivestreams.Publisher<? extends JWK> keys)
      Description copied from interface: JOSEObjectService

      Returns a new JOSE object reader with the specified payload type and using the specified keys.

      The returned reader will use the specified keys to verify or decrypt the JOSE object, the first succeeding key will be retained and remaining keys will be ignored. It will fail if no suitable key have been specified or if they are not consistent with the JOSE header.

      Specified by:
      reader in interface JOSEObjectService
      Specified by:
      reader in interface JWEService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to verify or decrypt the JOSE object
      Returns:
      a new JOSE object reader
    • jsonBuilder

      public <T> JsonJWEBuilder<T,?,?> jsonBuilder(Type type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object builder with the specified payload type.

      Specified by:
      jsonBuilder in interface JOSEObjectService
      Specified by:
      jsonBuilder in interface JWEService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object builder
    • jsonReader

      public <T> JsonJWEReader<T,?> jsonReader(Type type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object reader with the specified payload type.

      Specified by:
      jsonReader in interface JOSEObjectService
      Specified by:
      jsonReader in interface JWEService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object reader