Interface JsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends JsonJOSEObjectReader<A,B,C>>

Type Parameters:
A - the payload type
B - the JSON JOSE object type
C - the JSON JOSE object reader type
All Known Subinterfaces:
JsonJWEReader<A,B>, JsonJWSReader<A,B>

public interface JsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends JsonJOSEObjectReader<A,B,C>>

A JSON JWE reader is used to read JSON JOSE objects serialized using the JSON representation.

Since:
1.5
Author:
Jeremy Kuhn
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    processedParameters(String... parameters)
    Specifies the JOSE header custom parameters processed by the application.
    default Mono<B>
    read(String json)
    Reads the specified JSON representation and returns the corresponding JSON JOSE object.
    read(String json, String contentType)
    Reads the specified JSON representation using the specified payload media type and returns the corresponding JSON JOSE object.
    read(String json, Function<String,Mono<A>> payloadDecoder)
    Reads the specified JSON representation using the specified payload decoder and returns the corresponding JSON JOSE object.
  • Method Details

    • processedParameters

      C processedParameters(String... parameters)

      Specifies the JOSE header custom parameters processed by the application.

      These parameters are expected to be present in JOSE headers, they are not processed by the reader but by the application reading the JSON JOSE object. This enables the reader to check that the critical parameters set defined in the JOSE headers actually contains parameters that are understood and processed by either the reader or the application.

      Parameters:
      parameters - a list of parameters
      Returns:
      this reader
    • read

      Reads the specified JSON representation and returns the corresponding JSON JOSE object.

      The reader will rely on the payload media type specified in the JOSE headers to determine how to deserialize the payload. The operation will fail if it is not able to determine the media type converter to use. Please consider other read methods read(java.lang.String, java.lang.String) and read(java.lang.String, java.util.function.Function) to explicitly specifies how the payload should be deserialized.

      Parameters:
      json - a JSON JOSE object JSON representation
      Returns:
      a single JSON JOSE object publisher
      Throws:
      JOSEObjectReadException - if there was an error reading the JSON JOSE object
      JOSEObjectBuildException - if there was an error building the JSON JOSE object
      JOSEProcessingException - if there was a JOSE processing error
    • read

      Reads the specified JSON representation using the specified payload media type and returns the corresponding JSON JOSE object.

      The reader will use the specified media type to determine the converter to use to deserialize the payload and ignore the content type specified in the JOSE headers. The operation will fail if there is no media type converters defined for that particular media type. Media types converters are provided when building the JOSE module. Please consider read method read(java.lang.String, java.util.function.Function) to provide a custom payload decoder.

      Parameters:
      json - a JSON JOSE object JSON representation
      contentType - the expected payload media type
      Returns:
      a single JSON JOSE object publisher
      Throws:
      JOSEObjectReadException - if there was an error reading the JSON JOSE object
      JOSEObjectBuildException - if there was an error building the JSON JOSE object
      JOSEProcessingException - if there was a JOSE processing error
    • read

      Reads the specified JSON representation using the specified payload decoder and returns the corresponding JSON JOSE object.

      The reader will use the specified payload decoder to deserialize the payload and ignore the content type specified in the JOSE headers.

      Parameters:
      json - a JSON JOSE object JSON representation
      payloadDecoder - a payload decoder
      Returns:
      a single JSON JOSE object publisher
      Throws:
      JOSEObjectReadException - if there was an error reading the JSON JOSE object
      JOSEObjectBuildException - if there was an error building the JSON JOSE object
      JOSEProcessingException - if there was a JOSE processing error