Interface JOSEObjectReader<A,B extends JOSEHeader,C extends JOSEObject<A,B>,D extends JOSEObjectReader<A,B,C,D>>
- Type Parameters:
A
- the payload typeB
- the JOSE header typeC
- the JOSE object typeD
- the JOSE object reader type
A JOSE object reader is used to read single JOSE objects serialized in the compact representation.
JOSE objects can be serialized to compact representations as defined by RFC7515 Section 7.1 or RFC7516 Section 7.1.
- 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 compact representation and returns the corresponding JOSE object.Reads the specified compact representation using the specified payload media type and returns the corresponding JOSE object.Reads the specified compact representation using the specified payload decoder and returns the corresponding JOSE object.
-
Method Details
-
processedParameters
Specifies the JOSE header custom parameters processed by the application.
These parameters are expected to be present in the JOSE header, they are not processed by the reader but by the application reading the JOSE object. This enables the reader to check that the critical parameters set defined in the JOSE header 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<C> read(String compact) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException Reads the specified compact representation and returns the corresponding JOSE object.
The reader will rely on the payload media type specified in the JOSE header 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:
compact
- a JOSE object compact representation- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectReadException
- if there was an error reading the JOSE objectJOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
read
Mono<C> read(String compact, String contentType) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingException Reads the specified compact representation using the specified payload media type and returns the corresponding 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 header. 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:
compact
- a JOSE object compact representationcontentType
- the expected payload media type- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectReadException
- if there was an error reading the JOSE objectJOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-
read
Mono<C> read(String compact, Function<String, Mono<A>> payloadDecoder) throws JOSEObjectReadException, JOSEObjectBuildException, JOSEProcessingExceptionReads the specified compact representation using the specified payload decoder and returns the corresponding JOSE object.
The reader will use the specified payload decoder to deserialize the payload and ignore the content type specified in the JOSE header.
- Parameters:
compact
- a JOSE object compact representationpayloadDecoder
- a payload decoder- Returns:
- a single JOSE object publisher
- Throws:
JOSEObjectReadException
- if there was an error reading the JOSE objectJOSEObjectBuildException
- if there was an error building the JOSE objectJOSEProcessingException
- if there was a JOSE processing error
-