Interface JsonJWSBuilder<A,B extends JWSHeaderConfigurator<B>,C extends JsonJWSBuilder<A,B,C>>

Type Parameters:
A - the payload type
B - the JWS JOSE header configurator type
C - the JSON JWS builder type
All Superinterfaces:
JsonJOSEObjectBuilder<A,JsonJWS<A,JsonJWS.BuiltSignature<A>>,B,C>

public interface JsonJWSBuilder<A,B extends JWSHeaderConfigurator<B>,C extends JsonJWSBuilder<A,B,C>> extends 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 Type
    Method
    Description
    default C
    signature(Consumer<B> protectedHeaderConfigurer, Consumer<B> unprotectedHeaderConfigurer)
    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.

    Methods inherited from interface io.inverno.mod.security.jose.JsonJOSEObjectBuilder

    build, build, build, headers, payload
  • Method Details

    • signature

      default C signature(Consumer<B> protectedHeaderConfigurer, Consumer<B> unprotectedHeaderConfigurer)

      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 configurer
      unprotectedHeaderConfigurer - 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 configurer
      unprotectedHeaderConfigurer - the unprotected JWE JOSE header configurer
      keys - the keys to consider to sign the payload
      Returns:
      this builder