Class DkimSigner


  • public class DkimSigner
    extends Object
    Main class providing a signature according to DKIM RFC 4871.
    Since:
    1.0.0
    Author:
    Torsten Krause (tk at markenwerk dot net), Florian Sager
    • Method Detail

      • addHeaderToSign

        public void addHeaderToSign​(String header)
        Adds a header to the set of headers that will be included in the signature, if present.
        Parameters:
        header - The name of the header.
      • removeHeaderToSign

        public void removeHeaderToSign​(String header)
        Removes a header from the set of headers that will be included in the signature, unless it is one of the required headers ('From', 'To', 'Subject').
        Parameters:
        header - The name of the header.
      • setHeaderCanonicalization

        public void setHeaderCanonicalization​(Canonicalization canonicalization)
        Sets the Canonicalization to be used for the headers.
        Parameters:
        canonicalization - The Canonicalization to be used for the headers.
      • getIdentity

        public String getIdentity()
        Returns the configured identity parameter.
        Returns:
        The configured identity parameter.
      • setIdentity

        public void setIdentity​(String identity)
                         throws DkimException
        Sets the identity parameter to be used.
        Parameters:
        identity - The identity to be used.
        Throws:
        DkimException - If the given identity parameter isn't the signing domain of this DkimSigner or an subdomain thereof.
      • getLengthParam

        public boolean getLengthParam()
        Returns the configured length parameter.
        Returns:
        The configured length parameter.
      • setLengthParam

        public void setLengthParam​(boolean lengthParam)
        Sets the length parameter to be used.
        Parameters:
        lengthParam - The length parameter to be used.
      • isZParam

        @Deprecated
        public boolean isZParam()
        Deprecated.
        Returns the configured z parameter.
        Returns:
        The configured z parameter.
      • setZParam

        @Deprecated
        public void setZParam​(boolean zParam)
        Deprecated.
        Sets the z parameter to be used.
        Parameters:
        zParam - The z parameter to be used.
      • isCopyHeaderFields

        public boolean isCopyHeaderFields()
        Returns the configured z parameter.
        Returns:
        The configured z parameter.
      • setCopyHeaderFields

        public void setCopyHeaderFields​(boolean copyHeaderFields)
        Sets the z parameter to be used.
        Parameters:
        zParam - The z parameter to be used.
      • isCheckDomainKey

        public boolean isCheckDomainKey()
        Returns whether the domain key should be retrieved and checked.
        Returns:
        Whether the domain key should be retrieved and checked.
        See Also:
        DomainKey#check(String, RSAPrivateKey)
      • setCheckDomainKey

        public void setCheckDomainKey​(boolean checkDomainKey)
        Sets, whether the domain key should be retrieved and checked.
        Parameters:
        checkDomainKey - Whether the domain key should be retrieved and checked.