Class DomainKeyUtil


  • public final class DomainKeyUtil
    extends Object
    Since:
    1.0.0
    Author:
    Torsten Krause (tk at markenwerk dot net), Florian Sager
    • Method Detail

      • getCacheTtl

        public static long getCacheTtl()
        Returns the configured TTL (time to live) for retrieved DomainKey s.
        Returns:
        The configured TTL for retrieved DomainKeys.
      • setCacheTtl

        public static void setCacheTtl​(long cacheTtl)
        Sets the TTL (time to live) for retrieved DomainKeys.
        Parameters:
        cacheTtl - The TTL for retrieved DomainKeys.
      • getDomainKey

        public static DomainKey getDomainKey​(String signingDomain,
                                             String selector)
                                      throws DkimException
        Retrieves the DomainKey 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.