java.lang.Object
io.inverno.mod.security.jose.internal.jws.GenericJWSService
All Implemented Interfaces:
JOSEObjectService, JWSService

public class GenericJWSService extends Object implements JWSService

Generic JWSService implementation.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • GenericJWSService

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

      Creates a generic JWS service.

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

    • init

      public void init()

      Initializes the JWS service.

    • builder

      public <T> JWSBuilder<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 JWSService
      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> JWSReader<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 JWSService
      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> JsonJWSBuilder<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 JWSService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object builder
    • jsonReader

      public <T> JsonJWSReader<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 JWSService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object reader