org.jboss.resteasy.security.doseta
Class DosetaKeyRepository

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

public class DosetaKeyRepository
extends Object
implements KeyRepository

Version:
$Revision: 1 $
Author:
Bill Burke

Nested Class Summary
protected  class DosetaKeyRepository.CacheEntry<T>
           
 
Field Summary
protected  long cacheTimeout
           
protected  String defaultPrivateDomain
           
protected  String dnsUri
           
protected  KeyStoreKeyRepository keyStore
           
protected  String keyStoreFile
           
protected  String keyStorePassword
           
protected  String keyStorePath
           
protected  ConcurrentHashMap<String,DosetaKeyRepository.CacheEntry<PrivateKey>> privateCache
           
protected  ConcurrentHashMap<String,DosetaKeyRepository.CacheEntry<PublicKey>> publicCache
           
protected  boolean useDns
           
protected  boolean userPrincipalAsPrivateSelector
           
 
Constructor Summary
DosetaKeyRepository()
           
 
Method Summary
protected  void addPrivate(String alias, PrivateKey key)
           
protected  void addPublic(String alias, PublicKey key)
           
protected  PublicKey findFromDns(String alias)
           
 PrivateKey findPrivateKey(DKIMSignature header)
           
 PublicKey findPublicKey(DKIMSignature header)
           
 String getAlias(DKIMSignature header)
           
 long getCacheTimeout()
           
 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
 String getDnsUri()
           
 KeyStoreKeyRepository getKeyStore()
           
 String getKeyStoreFile()
           
 String getKeyStorePassword()
           
 String getKeyStorePath()
           
protected  PrivateKey getPrivateCache(String alias)
           
protected  PublicKey getPublicCache(String alias)
           
 boolean isUseDns()
           
 boolean isUserPrincipalAsPrivateSelector()
           
 void setCacheTimeout(long cacheTimeout)
           
 void setDefaultPrivateDomain(String defaultPrivateDomain)
           
 void setDnsUri(String dnsUri)
           
 void setKeyStore(KeyStoreKeyRepository keyStore)
           
 void setKeyStoreFile(String keyStoreFile)
           
 void setKeyStorePassword(String keyStorePassword)
           
 void setKeyStorePath(String keyStorePath)
           
 void setUseDns(boolean useDns)
           
 void setUserPrincipalAsPrivateSelector(boolean userPrincipalAsPrivateSelector)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

privateCache

protected ConcurrentHashMap<String,DosetaKeyRepository.CacheEntry<PrivateKey>> privateCache

publicCache

protected ConcurrentHashMap<String,DosetaKeyRepository.CacheEntry<PublicKey>> publicCache

keyStore

protected KeyStoreKeyRepository keyStore

defaultPrivateDomain

protected String defaultPrivateDomain

useDns

protected boolean useDns

userPrincipalAsPrivateSelector

protected boolean userPrincipalAsPrivateSelector

dnsUri

protected String dnsUri

cacheTimeout

protected long cacheTimeout

keyStorePath

protected String keyStorePath

keyStoreFile

protected String keyStoreFile

keyStorePassword

protected String keyStorePassword
Constructor Detail

DosetaKeyRepository

public DosetaKeyRepository()
Method Detail

start

public void start()

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

getKeyStorePath

public String getKeyStorePath()

setKeyStorePath

public void setKeyStorePath(String keyStorePath)

getKeyStoreFile

public String getKeyStoreFile()

setKeyStoreFile

public void setKeyStoreFile(String keyStoreFile)

getKeyStorePassword

public String getKeyStorePassword()

setKeyStorePassword

public void setKeyStorePassword(String keyStorePassword)

getKeyStore

public KeyStoreKeyRepository getKeyStore()

setKeyStore

public void setKeyStore(KeyStoreKeyRepository keyStore)

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

setDefaultPrivateDomain

public void setDefaultPrivateDomain(String defaultPrivateDomain)

isUseDns

public boolean isUseDns()

setUseDns

public void setUseDns(boolean useDns)

isUserPrincipalAsPrivateSelector

public boolean isUserPrincipalAsPrivateSelector()

setUserPrincipalAsPrivateSelector

public void setUserPrincipalAsPrivateSelector(boolean userPrincipalAsPrivateSelector)

getDnsUri

public String getDnsUri()

setDnsUri

public void setDnsUri(String dnsUri)

getCacheTimeout

public long getCacheTimeout()

setCacheTimeout

public void setCacheTimeout(long cacheTimeout)

addPrivate

protected void addPrivate(String alias,
                          PrivateKey key)

addPublic

protected void addPublic(String alias,
                         PublicKey key)

getPrivateCache

protected PrivateKey getPrivateCache(String alias)

getPublicCache

protected PublicKey getPublicCache(String alias)

getAlias

public String getAlias(DKIMSignature header)

findPrivateKey

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

findPublicKey

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

findFromDns

protected PublicKey findFromDns(String alias)


Copyright © 2013. All Rights Reserved.