Interface JWSService

All Superinterfaces:
JOSEObjectService

public interface JWSService extends JOSEObjectService

The JWS Service is the main entry point for creating and reading JSON Web Signature objects.

It allows to fluently create JWS objects using JWSBuilder for compact serialization or JsonJWSBuilder for JSON serialization. It also exposes JWSReader and JsonJWSReader to read JWS compact representation or JWS JSON representation respectively.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> JWSBuilder<T,?,?>
    Returns a new JOSE object builder.
    default <T> JWSBuilder<T,?,?>
    builder(Class<T> type)
    Returns a new JOSE object builder with the specified payload type.
    default <T> JWSBuilder<T,?,?>
    builder(Class<T> type, Publisher<? extends JWK> keys)
    Returns a new JOSE object builder with the specified payload type and using the specified keys.
    default <T> JWSBuilder<T,?,?>
    builder(Type type)
    Returns a new JOSE object builder with the specified payload type.
    <T> JWSBuilder<T,?,?>
    builder(Type type, Publisher<? extends JWK> keys)
    Returns a new JOSE object builder with the specified payload type and using the specified keys.
    default <T> JWSBuilder<T,?,?>
    builder(Publisher<? extends JWK> keys)
    Returns a new JOSE object builder using the specified keys.
    default <T> JsonJWSBuilder<T,?,?>
    Returns a new JSON JOSE object builder.
    default <T> JsonJWSBuilder<T,?,?>
    jsonBuilder(Class<T> type)
    Returns a new JSON JOSE object builder with the specified payload type.
    <T> JsonJWSBuilder<T,?,?>
    Returns a new JSON JOSE object builder with the specified payload type.
    default <T> JsonJWSReader<T,?>
    jsonReader(Class<T> type)
    Returns a new JSON JOSE object reader with the specified payload type.
    <T> JsonJWSReader<T,?>
    Returns a new JSON JOSE object reader with the specified payload type.
    default <T> JWSReader<T,?>
    reader(Class<T> type)
    Returns a new JOSE object reader with the specified payload type.
    default <T> JWSReader<T,?>
    reader(Class<T> type, Publisher<? extends JWK> keys)
    Returns a new JOSE object reader with the specified payload type and using the specified keys.
    default <T> JWSReader<T,?>
    reader(Type type)
    Returns a new JOSE object reader with the specified payload type.
    <T> JWSReader<T,?>
    reader(Type type, Publisher<? extends JWK> keys)
    Returns a new JOSE object reader with the specified payload type and using the specified keys.
  • Method Details

    • builder

      default <T> JWSBuilder<T,?,?> 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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Returns:
      a new JOSE object builder
    • builder

      default <T> JWSBuilder<T,?,?> builder(Class<T> type)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JOSE object builder
    • builder

      default <T> JWSBuilder<T,?,?> builder(Type type)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JOSE object builder
    • builder

      default <T> JWSBuilder<T,?,?> builder(Publisher<? extends JWK> keys)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      keys - the keys to consider to secure the JOSE object
      Returns:
      a new JOSE object builder
    • builder

      default <T> JWSBuilder<T,?,?> builder(Class<T> type, Publisher<? extends JWK> keys)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to secure the JOSE object
      Returns:
      a new JOSE object builder
    • builder

      <T> JWSBuilder<T,?,?> builder(Type type, Publisher<? extends JWK> keys)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to secure the JOSE object
      Returns:
      a new JOSE object builder
    • reader

      default <T> JWSReader<T,?> reader(Class<T> type)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JOSE object reader
    • reader

      default <T> JWSReader<T,?> reader(Type type)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JOSE object reader
    • reader

      default <T> JWSReader<T,?> reader(Class<T> type, Publisher<? extends JWK> keys)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to verify or decrypt the JOSE object
      Returns:
      a new JOSE object reader
    • reader

      <T> JWSReader<T,?> reader(Type type, Publisher<? extends JWK> keys)
      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 interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      keys - the keys to consider to verify or decrypt the JOSE object
      Returns:
      a new JOSE object reader
    • jsonBuilder

      default <T> JsonJWSBuilder<T,?,?> jsonBuilder()
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object builder.

      Specified by:
      jsonBuilder in interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Returns:
      a new JSON JOSE object builder
    • jsonBuilder

      default <T> JsonJWSBuilder<T,?,?> jsonBuilder(Class<T> type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object builder with the specified payload type.

      Specified by:
      jsonBuilder in interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object builder
    • jsonBuilder

      <T> JsonJWSBuilder<T,?,?> jsonBuilder(Type type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object builder with the specified payload type.

      Specified by:
      jsonBuilder in interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object builder
    • jsonReader

      default <T> JsonJWSReader<T,?> jsonReader(Class<T> type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object reader with the specified payload type.

      Specified by:
      jsonReader in interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object reader
    • jsonReader

      <T> JsonJWSReader<T,?> jsonReader(Type type)
      Description copied from interface: JOSEObjectService

      Returns a new JSON JOSE object reader with the specified payload type.

      Specified by:
      jsonReader in interface JOSEObjectService
      Type Parameters:
      T - the payload type
      Parameters:
      type - the payload type
      Returns:
      a new JSON JOSE object reader