- All Superinterfaces:
JOSEObjectService
The JWE Service is the main entry point for creating and reading JSON Web Encryption objects.
It allows to fluently create JWE objects using JWEBuilder
for compact serialization or JsonJWEBuilder
for JSON serialization. It also exposes JWEReader
and
JsonJWEReader
to read JWE compact representation or JWE JSON representation respectively.
Please refer to RFC7516 Section 7.1 for compact serialization and to RFC7516 Section 7.2 for JSON serialization.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> JWEBuilder
<T, ?, ?> builder()
Returns a new JOSE object builder.default <T> JWEBuilder
<T, ?, ?> Returns a new JOSE object builder with the specified payload type.default <T> JWEBuilder
<T, ?, ?> Returns a new JOSE object builder with the specified payload type and using the specified keys.default <T> JWEBuilder
<T, ?, ?> Returns a new JOSE object builder with the specified payload type.<T> JWEBuilder
<T, ?, ?> Returns a new JOSE object builder with the specified payload type and using the specified keys.default <T> JWEBuilder
<T, ?, ?> Returns a new JOSE object builder using the specified keys.default <T> JsonJWEBuilder
<T, ?, ?> Returns a new JSON JOSE object builder.default <T> JsonJWEBuilder
<T, ?, ?> jsonBuilder
(Class<T> type) Returns a new JSON JOSE object builder with the specified payload type.<T> JsonJWEBuilder
<T, ?, ?> jsonBuilder
(Type type) Returns a new JSON JOSE object builder with the specified payload type.default <T> JsonJWEReader
<T, ?> jsonReader
(Class<T> type) Returns a new JSON JOSE object reader with the specified payload type.<T> JsonJWEReader
<T, ?> jsonReader
(Type type) Returns a new JSON JOSE object reader with the specified payload type.default <T> JWEReader
<T, ?> Returns a new JOSE object reader with the specified payload type.default <T> JWEReader
<T, ?> Returns a new JOSE object reader with the specified payload type and using the specified keys.default <T> JWEReader
<T, ?> Returns a new JOSE object reader with the specified payload type.<T> JWEReader
<T, ?> Returns a new JOSE object reader with the specified payload type and using the specified keys.
-
Method Details
-
builder
Description copied from interface:JOSEObjectService
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.
- Specified by:
builder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Returns:
- a new JOSE object builder
-
builder
Description copied from interface:JOSEObjectService
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.
- Specified by:
builder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object builder
-
builder
Description copied from interface:JOSEObjectService
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.
- Specified by:
builder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object builder
-
builder
Description copied from interface:JOSEObjectService
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.
- Specified by:
builder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
keys
- the keys to consider to secure the JOSE object- Returns:
- a new JOSE object builder
-
builder
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 interfaceJOSEObjectService
- 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
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 interfaceJOSEObjectService
- 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
Description copied from interface:JOSEObjectService
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.
- Specified by:
reader
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object reader
-
reader
Description copied from interface:JOSEObjectService
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.
- Specified by:
reader
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JOSE object reader
-
reader
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 interfaceJOSEObjectService
- 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
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 interfaceJOSEObjectService
- 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
Description copied from interface:JOSEObjectService
Returns a new JSON JOSE object builder.
- Specified by:
jsonBuilder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonBuilder
Description copied from interface:JOSEObjectService
Returns a new JSON JOSE object builder with the specified payload type.
- Specified by:
jsonBuilder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonBuilder
Description copied from interface:JOSEObjectService
Returns a new JSON JOSE object builder with the specified payload type.
- Specified by:
jsonBuilder
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object builder
-
jsonReader
Description copied from interface:JOSEObjectService
Returns a new JSON JOSE object reader with the specified payload type.
- Specified by:
jsonReader
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object reader
-
jsonReader
Description copied from interface:JOSEObjectService
Returns a new JSON JOSE object reader with the specified payload type.
- Specified by:
jsonReader
in interfaceJOSEObjectService
- Type Parameters:
T
- the payload type- Parameters:
type
- the payload type- Returns:
- a new JSON JOSE object reader
-