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 long
getCacheTtl()
Returns the configured TTL (time to live) for retrievedDomainKey
s.static DomainKey
getDomainKey(String signingDomain, String selector)
Retrieves theDomainKey
for 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 String
getValue(String signingDomain, String selector)
Retrieves the raw domain key for the given signing domain and selector.static void
setCacheTtl(long cacheTtl)
Sets the TTL (time to live) for retrievedDomainKey
s.
-
-
-
Method Detail
-
getCacheTtl
public static long getCacheTtl()
Returns the configured TTL (time to live) for retrievedDomainKey
s.- Returns:
- The configured TTL for retrieved
DomainKey
s.
-
setCacheTtl
public static void setCacheTtl(long cacheTtl)
Sets the TTL (time to live) for retrievedDomainKey
s.- Parameters:
cacheTtl
- The TTL for retrievedDomainKey
s.
-
getDomainKey
public static DomainKey getDomainKey(String signingDomain, String selector) throws DkimException
Retrieves theDomainKey
for 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.
-
-