Interface JsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends JsonJOSEObjectReader<A,B,C>>
- Type Parameters:
A
- the payload typeB
- the JSON JOSE object typeC
- the JSON JOSE object reader type
- All Known Subinterfaces:
JsonJWEReader<A,
,B> JsonJWSReader<A,
B>
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 TypeMethodDescriptionprocessedParameters
(String... parameters) Specifies the JOSE header custom parameters processed by the application.Reads the specified JSON representation and returns the corresponding JSON JOSE object.Reads the specified JSON representation using the specified payload media type and returns the corresponding JSON JOSE object.Reads the specified JSON representation using the specified payload decoder and returns the corresponding JSON JOSE object.
-
Method Details
-
processedParameters
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
default Mono<B> read(String json) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException 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)
andread(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 objectJOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
read
Mono<B> read(String json, String contentType) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException 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 representationcontentType
- the expected payload media type- Returns:
- a single JSON JOSE object publisher
- Throws:
JOSEObjectReadException
- if there was an error reading the JSON JOSE objectJOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
read
Mono<B> read(String json, Function<String, Mono<A>> payloadDecoder) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingExceptionReads 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 representationpayloadDecoder
- a payload decoder- Returns:
- a single JSON JOSE object publisher
- Throws:
JOSEObjectReadException
- if there was an error reading the JSON JOSE objectJOSEObjectBuildException
- if there was an error building the JSON JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-