Interface JOSEObjectService
- All Known Subinterfaces:
JWEService
,JWSService
A JOSE object service is a main entry point for creating and reading particular JOSE objects.
It allows to fluently create JOSE objects using JOSEObjectBuilder
for compact serialization or JsonJOSEObjectBuilder
for JSON serialization. It also exposes JOSEObjectReader
and JsonJOSEObjectReader
to read compact representation or JSON representation respectively.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> builder()
Returns a new JOSE object builder.<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> Returns a new JOSE object builder with the specified payload type.<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> Returns a new JOSE object builder with the specified payload type and using the specified keys.<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> Returns a new JOSE object builder with the specified payload type.<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> Returns a new JOSE object builder with the specified payload type and using the specified keys.<T> JOSEObjectBuilder
<T, ?, ?, ?, ?> Returns a new JOSE object builder using the specified keys.<T> JsonJOSEObjectBuilder
<T, ?, ?, ?> Returns a new JSON JOSE object builder.<T> JsonJOSEObjectBuilder
<T, ?, ?, ?> jsonBuilder
(Class<T> type) Returns a new JSON JOSE object builder with the specified payload type.<T> JsonJOSEObjectBuilder
<T, ?, ?, ?> jsonBuilder
(Type type) Returns a new JSON JOSE object builder with the specified payload type.<T> JsonJOSEObjectReader
<T, ?, ?> jsonReader
(Class<T> type) Returns a new JSON JOSE object reader with the specified payload type.<T> JsonJOSEObjectReader
<T, ?, ?> jsonReader
(Type type) Returns a new JSON JOSE object reader with the specified payload type.<T> JOSEObjectReader
<T, ?, ?, ?> Returns a new JOSE object reader with the specified payload type.<T> JOSEObjectReader
<T, ?, ?, ?> Returns a new JOSE object reader with the specified payload type and using the specified keys.<T> JOSEObjectReader
<T, ?, ?, ?> Returns a new JOSE object reader with the specified payload type.<T> JOSEObjectReader
<T, ?, ?, ?> Returns a new JOSE object reader with the specified payload type and using the specified keys.
-
Method Details
-
builder
Returns a new JOSE object builder.
The returned builder will try to resolve the JWK to use to secure the JOSE object based on the JOSE header. It will fail if it wasn't able to find a suitable key.
- Type Parameters:
T
- the payload type- Returns:
- a new JOSE object builder
-
builder
Returns a new JOSE object builder with the specified payload type.
The returned builder will try to resolve the JWK to use to secure the JOSE object based on the JOSE header. It will fail if it wasn't able to find a suitable key.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object builder
-
builder
Returns a new JOSE object builder with the specified payload type.
The returned builder will try to resolve the JWK to use to secure the JOSE object based on the JOSE header. It will fail if it wasn't able to find a suitable key.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object builder
-
builder
Returns a new JOSE object builder 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.
- Type Parameters:
T
- the payload type- Parameters:
keys
- the keys to consider to secure the JOSE object- Returns:
- a new JOSE object builder
-
builder
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.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload typekeys
- the keys to consider to secure the JOSE object- Returns:
- a new JOSE object builder
-
builder
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.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload typekeys
- the keys to consider to secure the JOSE object- Returns:
- a new JOSE object builder
-
reader
Returns a new JOSE object reader with the specified payload type.
The returned reader will try to resolve the public JWK that corresponds to the key used to secure the JOSE object based on the JOSE header. It will fail if it wasn't able to find a suitable key.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object reader
-
reader
Returns a new JOSE object reader with the specified payload type.
The returned reader will try to resolve the public JWK that corresponds to the key used to secure the JOSE object based on the JOSE header. It will fail if it wasn't able to find a suitable key.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object reader
-
reader
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.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload typekeys
- the keys to consider to verify or decrypt the JOSE object- Returns:
- a new JOSE object reader
-
reader
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.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload typekeys
- the keys to consider to verify or decrypt the JOSE object- Returns:
- a new JOSE object reader
-
jsonBuilder
Returns a new JSON JOSE object builder.
- Type Parameters:
T
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonBuilder
Returns a new JSON JOSE object builder with the specified payload type.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonBuilder
Returns a new JSON JOSE object builder with the specified payload type.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonReader
Returns a new JSON JOSE object reader with the specified payload type.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object reader
-
jsonReader
Returns a new JSON JOSE object reader with the specified payload type.
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object reader
-