dkim-signer
v0.2.2
Published
DKIM signing code extracted from mailcomposer
Downloads
754,786
Readme
DKIM Signer
Sign RFC822 messages with DKIM. This module is extracted from mailcomposer.
Usage
// require signer function
var DKIMSign = require("dkim-signer").DKIMSign;
// generate a RFC822 message
var rfc822message = "Subject: test\r\n\r\nHello world";
// setup DKIM options
var dkimOptions = {
domainName: "müriaad-polüteism.info",
keySelector: "dkim",
privateKey: require("fs").readFileSync("./test_private.pem")
};
// generate signature header field
var signature = DKIMSign(rfc822message, dkimOptions);
// join signature header field with the message
console.log(signature + "\r\n" + rfc822message);
License
MIT