Package org.jboss.resteasy.security.doseta

## Class Verification

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

-     public class Verification
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected String` | `algorithm` |
    `protected boolean` | `bodyHashRequired` |
    `protected String` | `identifierName` |
    `protected String` | `identifierValue` |
    `protected boolean` | `ignoreExpiration` |
    `protected PublicKey` | `key` |
    `protected KeyRepository` | `repository` |
    `protected Map<String,​String>` | `requiredAttributes` |
    `protected boolean` | `staleCheck` |
    `protected int` | `staleDays` |
    `protected int` | `staleHours` |
    `protected int` | `staleMinutes` |
    `protected int` | `staleMonths` |
    `protected int` | `staleSeconds` |
    `protected int` | `staleYears` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Verification()` |
    `Verification​(PublicKey key)` |
    `Verification​(KeyRepository repository)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getAlgorithm()` |
    `String` | `getIdentifierName()` |
    `String` | `getIdentifierValue()` |
    `PublicKey` | `getKey()` |
    `KeyRepository` | `getRepository()` |
    `Map<String,​String>` | `getRequiredAttributes()` |
    `int` | `getStaleDays()` |
    `int` | `getStaleHours()` |
    `int` | `getStaleMinutes()` |
    `int` | `getStaleMonths()` |
    `int` | `getStaleSeconds()` |
    `int` | `getStaleYears()` |
    `boolean` | `isBodyHashRequired()` |
    `boolean` | `isIgnoreExpiration()` |
    `boolean` | `isStaleCheck()` |
    `void` | `setAlgorithm​(String algorithm)` |
    `void` | `setBodyHashRequired​(boolean bodyHashRequired)` |
    `void` | `setIdentifierName​(String identifierName)` |
    `void` | `setIdentifierValue​(String identifierValue)` |
    `void` | `setIgnoreExpiration​(boolean ignoreExpiration)` |
    `void` | `setKey​(PublicKey key)` |
    `void` | `setRepository​(KeyRepository repository)` |
    `void` | `setStaleCheck​(boolean staleCheck)` |
    `void` | `setStaleDays​(int staleDays)` |
    `void` | `setStaleHours​(int staleHours)` |
    `void` | `setStaleMinutes​(int staleMinutes)` |
    `void` | `setStaleMonths​(int staleMonths)` |
    `void` | `setStaleSeconds​(int staleSeconds)` |
    `void` | `setStaleYears​(int staleYears)` |
    `javax.ws.rs.core.MultivaluedMap<String,​String>` | `verify​(DKIMSignature signature, Map headers, byte[] body, PublicKey publicKey)` | Headers can be a Map<String, Object> or a Map<String, List<Object>>.

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

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

- - ### Field Detail

    - #### key

          protected PublicKey key

    - #### repository

          protected KeyRepository repository

    - #### algorithm

          protected String algorithm

    - #### requiredAttributes

          protected Map<String,​String> requiredAttributes

    - #### identifierName

          protected String identifierName

    - #### identifierValue

          protected String identifierValue

    - #### staleCheck

          protected boolean staleCheck

    - #### ignoreExpiration

          protected boolean ignoreExpiration

    - #### staleSeconds

          protected int staleSeconds

    - #### staleMinutes

          protected int staleMinutes

    - #### staleHours

          protected int staleHours

    - #### staleDays

          protected int staleDays

    - #### staleMonths

          protected int staleMonths

    - #### staleYears

          protected int staleYears

    - #### bodyHashRequired

          protected boolean bodyHashRequired

  - ### Constructor Detail

    - #### Verification

          public Verification()

    - #### Verification

          public Verification​(PublicKey key)

    - #### Verification

          public Verification​(KeyRepository repository)

  - ### Method Detail

    - #### isBodyHashRequired

          public boolean isBodyHashRequired()

    - #### setBodyHashRequired

          public void setBodyHashRequired​(boolean bodyHashRequired)

    - #### getIdentifierName

          public String getIdentifierName()

    - #### setIdentifierName

          public void setIdentifierName​(String identifierName)

    - #### getIdentifierValue

          public String getIdentifierValue()

    - #### setIdentifierValue

          public void setIdentifierValue​(String identifierValue)

    - #### isIgnoreExpiration

          public boolean isIgnoreExpiration()

    - #### setIgnoreExpiration

          public void setIgnoreExpiration​(boolean ignoreExpiration)

    - #### isStaleCheck

          public boolean isStaleCheck()

    - #### setStaleCheck

          public void setStaleCheck​(boolean staleCheck)

    - #### getRequiredAttributes

          public Map<String,​String> getRequiredAttributes()

    - #### getAlgorithm

          public String getAlgorithm()

    - #### setAlgorithm

          public void setAlgorithm​(String algorithm)

    - #### getKey

          public PublicKey getKey()

    - #### setKey

          public void setKey​(PublicKey key)

    - #### getRepository

          public KeyRepository getRepository()

    - #### setRepository

          public void setRepository​(KeyRepository repository)

    - #### getStaleSeconds

          public int getStaleSeconds()

    - #### setStaleSeconds

          public void setStaleSeconds​(int staleSeconds)

    - #### getStaleMinutes

          public int getStaleMinutes()

    - #### setStaleMinutes

          public void setStaleMinutes​(int staleMinutes)

    - #### getStaleHours

          public int getStaleHours()

    - #### setStaleHours

          public void setStaleHours​(int staleHours)

    - #### getStaleDays

          public int getStaleDays()

    - #### setStaleDays

          public void setStaleDays​(int staleDays)

    - #### getStaleMonths

          public int getStaleMonths()

    - #### setStaleMonths

          public void setStaleMonths​(int staleMonths)

    - #### getStaleYears

          public int getStaleYears()

    - #### setStaleYears

          public void setStaleYears​(int staleYears)

    - #### verify

          public javax.ws.rs.core.MultivaluedMap<String,​String> verify​(DKIMSignature signature,
                                                                             Map headers,
                                                                             byte[] body,
                                                                             PublicKey publicKey)
                                                                      throws SignatureException

      Headers can be a Map<String, Object> or a Map<String, List<Object>>. This gives some compatibility with JAX-RS's MultivaluedMap. If a map of lists, every value of each header duplicate will be added.
      Parameters:
        `signature` - signature
        `headers` - headers map
        `body` - body
        `publicKey` - public key
      Returns:
        map of validated headers and their values
      Throws:
        `SignatureException` - if verification fails