org.jboss.resteasy.security.doseta

## Class DigitalSigningInterceptor

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

- All Implemented Interfaces:
    ClientRequestFilter, ContainerResponseFilter, WriterInterceptor, ClientExecutionInterceptor

      @Provider
      public class DigitalSigningInterceptor
      extends Object
      implements WriterInterceptor, ClientExecutionInterceptor, ContainerResponseFilter, ClientRequestFilter

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DigitalSigningInterceptor()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `aroundWriteTo(WriterInterceptorContext context)` Interceptor method wrapping calls to `MessageBodyWriter.writeTo(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>, java.io.OutputStream)` method.
    `ClientResponse` | `execute(ClientExecutionContext context)`
    `void` | `filter(ClientRequestContext requestContext)` Filter method called before a request has been dispatched to a client transport layer.
    `void` | `filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)` Filter method called after a response has been provided for a request (either by a `request filter` or by a matched resource method.
    `protected List<DKIMSignature>` | `getHeaders(MultivaluedMap<String,Object> headers)`
    `protected void` | `sign(KeyRepository repository, 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(MultivaluedMap<String,Object> headers)

    - #### filter

          public void filter(ClientRequestContext requestContext)
                      throws IOException

      Description copied from interface: `ClientRequestFilter`
      Filter method called before a request has been dispatched to a client transport layer. Filters in the filter chain are ordered according to their `javax.annotation.Priority` class-level annotation value.
      Specified by:
        `filter` in interface `ClientRequestFilter`
      Parameters:
        `requestContext` - request context.
      Throws:
        `IOException` - if an I/O exception occurs.

    - #### execute

          public ClientResponse execute(ClientExecutionContext context)
                                 throws Exception

      Specified by:
        `execute` in interface `ClientExecutionInterceptor`
      Throws:
        `Exception`

    - #### filter

          public void filter(ContainerRequestContext requestContext,
                    ContainerResponseContext responseContext)
                      throws IOException

      Description copied from interface: `ContainerResponseFilter`
      Filter method called after a response has been provided for a request (either by a `request filter` or by a matched resource method.

      Filters in the filter chain are ordered according to their `javax.annotation.Priority` class-level annotation value.

      Specified by:
        `filter` in interface `ContainerResponseFilter`
      Parameters:
        `requestContext` - request context.
        `responseContext` - response context.
      Throws:
        `IOException` - if an I/O exception occurs.

    - #### aroundWriteTo

          public void aroundWriteTo(WriterInterceptorContext context)
                             throws IOException,
                                    WebApplicationException

      Description copied from interface: `WriterInterceptor`
      Interceptor method wrapping calls to `MessageBodyWriter.writeTo(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>, java.io.OutputStream)` method. The parameters of the wrapped method called are available from `context`. Implementations of this method SHOULD explicitly call `WriterInterceptorContext.proceed()` to invoke the next interceptor in the chain, and ultimately the wrapped `MessageBodyWriter.writeTo` method.
      Specified by:
        `aroundWriteTo` in interface `WriterInterceptor`
      Parameters:
        `context` - invocation context.
      Throws:
        `IOException` - if an IO error arises or is thrown by the wrapped `MessageBodyWriter.writeTo` method.
        `WebApplicationException` - thrown by the wrapped `MessageBodyWriter.writeTo` method.

    - #### sign

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

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

Copyright © 2014. All Rights Reserved.