org.jboss.resteasy.security.doseta
Class ConfiguredDosetaKeyRepository

java.lang.Object
  extended by org.jboss.resteasy.security.doseta.ConfiguredDosetaKeyRepository
All Implemented Interfaces:
KeyRepository

public class ConfiguredDosetaKeyRepository
extends Object
implements KeyRepository

For use when you want repository created via a context object, i.e., when defined within a WAR file.

For WAR files, it will look in context parameters and servlet/filter init params for doseta variables.

Private keys are stored in a java keystore. Public keys may be stored in either a java keystore or discovered via DNS.

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  DosetaKeyRepository keyRepository
           
static String RESTEASY_DOSETA_CACHE_TIMEOUT
          Public keys are cached.
static String RESTEASY_DOSETA_DEFAULT_PRIVATE_DOMAIN
          Context parameter.
static String RESTEASY_DOSETA_DNS_URI
          Context parameter.
static String RESTEASY_DOSETA_PRINCIPAL_FOR_PRIVATE
          true|false.
static String RESTEASY_DOSETA_USE_DNS
          Context parameter.
static String RESTEASY_KEY_STORE_CLASSPATH
          Context parameter.
static String RESTEASY_KEY_STORE_FILE_NAME
          Context parameter.
static String RESTEASY_KEY_STORE_PASSWORD
          Context parameter.
 
Constructor Summary
ConfiguredDosetaKeyRepository(ResteasyConfiguration config)
           
 
Method Summary
 PrivateKey findPrivateKey(DKIMSignature header)
           
 PublicKey findPublicKey(DKIMSignature header)
           
 String getDefaultPrivateDomain()
          What should be the default domain to use when creating signature header
 String getDefaultPrivateSelector()
          What should be the default selector to use when creating signature header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESTEASY_KEY_STORE_FILE_NAME

public static String RESTEASY_KEY_STORE_FILE_NAME
Context parameter.

Hardcoded file path to your keystore


RESTEASY_KEY_STORE_CLASSPATH

public static String RESTEASY_KEY_STORE_CLASSPATH
Context parameter.

Find the java keystore by searching the classpath. This points to a file on the classpath


RESTEASY_KEY_STORE_PASSWORD

public static String RESTEASY_KEY_STORE_PASSWORD
Context parameter.

Password of the java keystore.


RESTEASY_DOSETA_USE_DNS

public static String RESTEASY_DOSETA_USE_DNS
Context parameter.

true|false. Whether or not to use DNS to discover public keys. By default looks in keystore


RESTEASY_DOSETA_DNS_URI

public static String RESTEASY_DOSETA_DNS_URI
Context parameter.

If you need to retrieve from a specific DNS server specify the url

dns://hostname:port


RESTEASY_DOSETA_DEFAULT_PRIVATE_DOMAIN

public static String RESTEASY_DOSETA_DEFAULT_PRIVATE_DOMAIN
Context parameter.

When signing, if no domain is specified, use this domain.


RESTEASY_DOSETA_CACHE_TIMEOUT

public static String RESTEASY_DOSETA_CACHE_TIMEOUT
Public keys are cached. Specify a timeout for these keys.


RESTEASY_DOSETA_PRINCIPAL_FOR_PRIVATE

public static String RESTEASY_DOSETA_PRINCIPAL_FOR_PRIVATE
true|false. When signing, if no selector is specified, use the user principal as the selector value.


keyRepository

protected DosetaKeyRepository keyRepository
Constructor Detail

ConfiguredDosetaKeyRepository

public ConfiguredDosetaKeyRepository(@Context
                                     ResteasyConfiguration config)
Method Detail

findPrivateKey

public PrivateKey findPrivateKey(DKIMSignature header)
Specified by:
findPrivateKey in interface KeyRepository

findPublicKey

public PublicKey findPublicKey(DKIMSignature header)
Specified by:
findPublicKey in interface KeyRepository

getDefaultPrivateSelector

public String getDefaultPrivateSelector()
Description copied from interface: KeyRepository
What should be the default selector to use when creating signature header

Specified by:
getDefaultPrivateSelector in interface KeyRepository
Returns:
null if none

getDefaultPrivateDomain

public String getDefaultPrivateDomain()
Description copied from interface: KeyRepository
What should be the default domain to use when creating signature header

Specified by:
getDefaultPrivateDomain in interface KeyRepository
Returns:
null if none


Copyright © 2011. All Rights Reserved.