Class DomainKey


  • public final class DomainKey
    extends Object
    A DomainKey holds the information about a domain key.
    Since:
    1.0.0
    Author:
    Torsten Krause (tk at markenwerk dot net)
    • Constructor Detail

      • DomainKey

        public DomainKey​(Map<Character,​String> tags)
                  throws DkimException
        Creates a new DomainKey from the given tags.
        Parameters:
        tags - The tags to be used.
        Throws:
        DkimException - If either the version, key type or service type given in the tags is incompatible to this library ('DKIM1', 'RSA' or 'Ed25519' and 'email' respectively).
    • Method Detail

      • getTimestamp

        public long getTimestamp()
        Returns the construction time of this DomainKey as a timestamp.
        Returns:
        The construction time of this DomainKey as a timestamp.
      • getGranularity

        public Pattern getGranularity()
        Returns a Pattern that matches the granularity of this DomainKey, as described in the 'g' tag.
        Returns:
        A Pattern that matches the granularity of this DomainKey.
      • getServiceTypes

        public Set<String> getServiceTypes()
        Returns the set of service types supported by this DomainKey, as described in the 's' tag.
        Returns:
        The set of service types supported by this DomainKey.
      • getPublicKeyType

        public KeyPairType getPublicKeyType()
        Returns the type of public key of this DomainKey, as provided by the 'p' tag.
        Returns:
        The type of public key of this DomainKey.
      • getPublicKey

        public PublicKey getPublicKey()
        Returns the public key of this DomainKey, as provided by the 'p' tag.
        Returns:
        The public key of this DomainKey.
      • getTags

        public Map<Character,​String> getTags()
        Returns the unmodifiable map of tags, this DomainKey was constructed from.
        Returns:
        The map of tags, this DomainKey was constructed from.