Package org.jboss.resteasy.security.doseta

## Class DigitalSigningInterceptor

- java.lang.Object
- - org.jboss.resteasy.security.doseta.DigitalSigningInterceptor

- All Implemented Interfaces:
    `javax.ws.rs.client.ClientRequestFilter`, `javax.ws.rs.container.ContainerResponseFilter`, `javax.ws.rs.ext.WriterInterceptor`, `AsyncWriterInterceptor`

      @Provider
      @Priority(4000)
      public class DigitalSigningInterceptor
      extends Object
      implements AsyncWriterInterceptor, javax.ws.rs.container.ContainerResponseFilter, javax.ws.rs.client.ClientRequestFilter

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DigitalSigningInterceptor()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `aroundWriteTo​(javax.ws.rs.ext.WriterInterceptorContext context)` |
    `CompletionStage<Void>` | `asyncAroundWriteTo​(AsyncWriterInterceptorContext context)` | Interceptor method wrapping calls to `AsyncMessageBodyWriter.asyncWriteTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, org.jboss.resteasy.spi.AsyncOutputStream)` method.
    `void` | `filter​(javax.ws.rs.client.ClientRequestContext requestContext)` |
    `void` | `filter​(javax.ws.rs.container.ContainerRequestContext requestContext, javax.ws.rs.container.ContainerResponseContext responseContext)` |
    `protected List<DKIMSignature>` | `getHeaders​(javax.ws.rs.core.MultivaluedMap<String,​Object> headers)` |
    `protected void` | `sign​(KeyRepository repository, javax.ws.rs.core.MultivaluedMap<String,​Object> headers, byte[] body, DKIMSignature dosetaSignature)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DigitalSigningInterceptor

          public DigitalSigningInterceptor()

  - ### Method Detail

    - #### getHeaders

          protected List<DKIMSignature> getHeaders​(javax.ws.rs.core.MultivaluedMap<String,​Object> headers)

    - #### filter

          public void filter​(javax.ws.rs.client.ClientRequestContext requestContext)
                      throws IOException

      Specified by:
        `filter` in interface `javax.ws.rs.client.ClientRequestFilter`
      Throws:
        `IOException`

    - #### filter

          public void filter​(javax.ws.rs.container.ContainerRequestContext requestContext,
                             javax.ws.rs.container.ContainerResponseContext responseContext)
                      throws IOException

      Specified by:
        `filter` in interface `javax.ws.rs.container.ContainerResponseFilter`
      Throws:
        `IOException`

    - #### aroundWriteTo

          public void aroundWriteTo​(javax.ws.rs.ext.WriterInterceptorContext context)
                             throws IOException,
                                    javax.ws.rs.WebApplicationException

      Specified by:
        `aroundWriteTo` in interface `javax.ws.rs.ext.WriterInterceptor`
      Throws:
        `IOException`
        `javax.ws.rs.WebApplicationException`

    - #### asyncAroundWriteTo

          public CompletionStage<Void> asyncAroundWriteTo​(AsyncWriterInterceptorContext context)

      Description copied from interface: `AsyncWriterInterceptor`
      Interceptor method wrapping calls to `AsyncMessageBodyWriter.asyncWriteTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, org.jboss.resteasy.spi.AsyncOutputStream)` method. The parameters of the wrapped method called are available from `context`. Implementations of this method SHOULD explicitly call `AsyncWriterInterceptorContext.asyncProceed()` to invoke the next interceptor in the chain, and ultimately the wrapped `AsyncMessageBodyWriter.asyncWriteTo` method.
      Specified by:
        `asyncAroundWriteTo` in interface `AsyncWriterInterceptor`
      Parameters:
        `context` - invocation context.
      Returns:
        a `CompletionStage` indicating completion

    - #### sign

          protected void sign​(KeyRepository repository,
                              javax.ws.rs.core.MultivaluedMap<String,​Object> headers,
                              byte[] body,
                              DKIMSignature dosetaSignature)
                       throws NoSuchAlgorithmException,
                              InvalidKeyException,
                              SignatureException,
                              UnsupportedEncodingException

      Throws:
        `NoSuchAlgorithmException`
        `InvalidKeyException`
        `SignatureException`
        `UnsupportedEncodingException`