Class ConfiguredDosetaKeyRepository
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected DosetaKeyRepositorykeyRepositorystatic StringRESTEASY_DOSETA_CACHE_TIMEOUTPublic keys are cached.static StringRESTEASY_DOSETA_DEFAULT_PRIVATE_DOMAINContext parameter.static StringRESTEASY_DOSETA_DNS_URIContext parameter.static StringRESTEASY_DOSETA_PRINCIPAL_FOR_PRIVATEtrue|false.static StringRESTEASY_DOSETA_USE_DNSContext parameter.static StringRESTEASY_KEY_STORE_CLASSPATHContext parameter.static StringRESTEASY_KEY_STORE_FILE_NAMEContext parameter.static StringRESTEASY_KEY_STORE_PASSWORDContext parameter.
-
Constructor Summary
Constructors Constructor Description ConfiguredDosetaKeyRepository(ResteasyConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrivateKeyfindPrivateKey(DKIMSignature header)PublicKeyfindPublicKey(DKIMSignature header)StringgetDefaultPrivateDomain()What should be the default domain to use when creating signature headerStringgetDefaultPrivateSelector()What should be the default selector to use when creating signature header
-
-
-
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:
findPrivateKeyin interfaceKeyRepository
-
findPublicKey
public PublicKey findPublicKey(DKIMSignature header)
- Specified by:
findPublicKeyin interfaceKeyRepository
-
getDefaultPrivateSelector
public String getDefaultPrivateSelector()
Description copied from interface:KeyRepositoryWhat should be the default selector to use when creating signature header- Specified by:
getDefaultPrivateSelectorin interfaceKeyRepository- Returns:
- null if none
-
getDefaultPrivateDomain
public String getDefaultPrivateDomain()
Description copied from interface:KeyRepositoryWhat should be the default domain to use when creating signature header- Specified by:
getDefaultPrivateDomainin interfaceKeyRepository- Returns:
- null if none
-
-