Interface JsonJWSBuilder<A,B extends JWSHeaderConfigurator<B>,C extends JsonJWSBuilder<A,B,C>>
- Type Parameters:
A
- the payload typeB
- the JWS JOSE header configurator typeC
- the JSON JWS builder type
- All Superinterfaces:
JsonJOSEObjectBuilder<A,
JsonJWS<A, JsonJWS.BuiltSignature<A>>, B, C>
A JSON JWS builder is used to build JSON Web Signature objects that can be serialized to the JSON representation as defined by RFC7515 Section 7.2.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptiondefault C
Specifies a signature to add to the resulting JSON JWS object.signature
(Consumer<B> protectedHeaderConfigurer, Consumer<B> unprotectedHeaderConfigurer, Publisher<? extends JWK> keys) Specifies a signature to add to the resulting JSON JWS object using the specified keys.
-
Method Details
-
signature
Specifies a signature to add to the resulting JSON JWS object.
The builder will try to resolve the JWK to use to sign the payload based on the JWS JOSE header resulting from the merge of the protected and unprotected headers. It will fail if it wasn't able to find a suitable key.
- Parameters:
protectedHeaderConfigurer
- the protected JWE JOSE header configurerunprotectedHeaderConfigurer
- the unprotected JWE JOSE header configurer- Returns:
- this builder
-
signature
C signature(Consumer<B> protectedHeaderConfigurer, Consumer<B> unprotectedHeaderConfigurer, Publisher<? extends JWK> keys) Specifies a signature to add to the resulting JSON JWS object using the specified keys.
The builder will use the specified keys to sign the payload, 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 JWS JOSE header resulting from the merge of the protected and unprotected headers.
- Parameters:
protectedHeaderConfigurer
- the protected JWE JOSE header configurerunprotectedHeaderConfigurer
- the unprotected JWE JOSE header configurerkeys
- the keys to consider to sign the payload- Returns:
- this builder
-