Package net.markenwerk.utils.mail.dkim
Class DomainKeyUtil
- java.lang.Object
-
- net.markenwerk.utils.mail.dkim.DomainKeyUtil
-
public final class DomainKeyUtil extends Object
- Since:
- 1.0.0
- Author:
- Torsten Krause (tk at markenwerk dot net), Florian Sager
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longgetCacheTtl()Returns the configured TTL (time to live) for retrievedDomainKeys.static DomainKeygetDomainKey(String signingDomain, String selector)Retrieves theDomainKeyfor the given signing domain and selector.static Map<Character,String>getTags(String signingDomain, String selector)Retrieves the tags of a domain key for the given signing domain and selector.static StringgetValue(String signingDomain, String selector)Retrieves the raw domain key for the given signing domain and selector.static voidsetCacheTtl(long cacheTtl)Sets the TTL (time to live) for retrievedDomainKeys.
-
-
-
Method Detail
-
getCacheTtl
public static long getCacheTtl()
Returns the configured TTL (time to live) for retrievedDomainKeys.- Returns:
- The configured TTL for retrieved
DomainKeys.
-
setCacheTtl
public static void setCacheTtl(long cacheTtl)
Sets the TTL (time to live) for retrievedDomainKeys.- Parameters:
cacheTtl- The TTL for retrievedDomainKeys.
-
getDomainKey
public static DomainKey getDomainKey(String signingDomain, String selector) throws DkimException
Retrieves theDomainKeyfor the given signing domain and selector.- Parameters:
signingDomain- The signing domain.selector- The selector.- Returns:
- The retrieved
DomainKey. - Throws:
DkimException- If the domain key couldn't be retrieved or if either the version, key type or service type given in the tags of the retrieved domain key is incompatible to this library ('DKIM1', 'RSA' and 'email' respectively).
-
getTags
public static Map<Character,String> getTags(String signingDomain, String selector) throws DkimException
Retrieves the tags of a domain key for the given signing domain and selector.- Parameters:
signingDomain- The signing domain.selector- The selector.- Returns:
- The retrieved tags.
- Throws:
DkimException- If the domain key couldn't be retrieved.
-
getValue
public static String getValue(String signingDomain, String selector) throws DkimException
Retrieves the raw domain key for the given signing domain and selector.- Parameters:
signingDomain- The signing domain.selector- The selector.- Returns:
- The raw domain key.
- Throws:
DkimException- If the domain key couldn't be retrieved.
-
-