简体   繁体   English

如何生成DomainKeys(不是DKIM)签名?

[英]How to generate a DomainKeys (not DKIM) signature?

I am using DKIM for JavaMail to sign outgoing mails with DKIM. 我正在使用DKIM for JavaMail与DKIM签署外发邮件。 Now, I would like to add a DomainKey-Signature . 现在,我想添加一个DomainKey-Signature From reading through the docs, specs and other related posts I know that the signing process is almost identical (using the same algorithm, DNS entries, etc.). 通过阅读文档,规范和其他相关文章,我知道签名过程几乎是相同的(使用相同的算法,DNS条目等)。 The only difference is that DKIM offers more options, eg In choosing which fields to sign. 唯一的区别是DKIM提供了更多选项,例如在选择要签名的字段时。 That makes it easy to select the signing fields (eg From, Subject) and generate the right hash values. 这样就可以轻松选择签名字段(例如“发件人”,“主题”)并生成正确的哈希值。

For DomainKeys I could not figure out which mail parts to hash though. 对于DomainKeys,我无法弄清楚要散列的邮件部分。 I read the docs but it is not clearly stated if you should only hash the body or the entire source code. 我阅读了文档,但是并没有明确说明仅散列正文还是整个源代码。 On a different website it says 在另一个网站上说

DomainKeys uses the 'From', and 'Sender' headers, as well as the message body, in combination with the Private Key to generate a DomainKeys signature DomainKeys使用“发件人”和“ Sender”标头以及消息正文,与私钥结合使用以生成DomainKeys签名

That makes sense - but what does it mean for my other header fields (eg Date, Message-ID) and what is meant by message body? 这是有道理的-但是它对我的其他标头字段(例如,日期,邮件ID)意味着什么,以及邮件正文是什么意思?

So my overall question is: 所以我的总体问题是:

What input (mail parts) do I use to generate the DomainKey hash? 我使用什么输入(邮件部分)来生成DomainKey哈希?

To find which header field signed by "DKIM for JavaMail" have a look into the source "DKIMSigner.java", they are specified in the array " String[] defaultHeadersToSign". 要查找由“ DKIM for JavaMail”签名的标题字段,请查看源代码“ DKIMSigner.java”,它们在数组“ String [] defaultHeadersToSign”中指定。

Body means the message itself (stripped down simplified structure of an email: header fields + one empty line + body). 正文表示邮件本身(简化了电子邮件的简化结构:标头字段+一个空行+正文)。

There is no need to use the depricated DomainKeys anymore, if you are already using DKIM. 如果您已经在使用DKIM,则不再需要使用已描述的DomainKey。 You may want have a look at this Implementation http://www.badpenguin.co.uk/dkim/ 您可能需要查看此实现http://www.badpenguin.co.uk/dkim/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM