MailBee.NET Objects 7.1

DomainKeys Class

Provides methods for signing e-mails with DomainKeys and DKIM signatures and verifying signatures of incoming e-mails.

For a list of all members of this type, see DomainKeys Members.

System.Object
   MailBee.Security.DomainKeys

public class DomainKeys

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This class serves two purposes:

Note   In many cases, you can use DomainKeysSign and DomainKeysVerify methods of MailMessage class to deal with DomainKeys and DKIM signatures. They are easier to use than DomainKeys class and do not require you to supply Smtp object.

If your domain does not have the necessary DNS TXT record holding DomainKeys data, you need to create one or contact your server administrator on this matter. You can create a public/private key pair with a tool such as OpenSSL. See RFC 4870 for more information.

Note   This class supports classic DomainKeys (DK) and newer DKIM technology. DK is always supported while DKIM support may require the operating system support SHA256 algorithm (supported in WinXP SP3 and above). Most DomainKeys-signed e-mails are signed using both technologies. Thus, you can usually check signatures even if the OS does not support SHA256. Also, it's always possible to sign e-mails with MailBee and DKIM. This is because DKIM allows using SHA1 (which is always supported) in addition to SHA256. MailBee always signs e-mails with SHA1. The problem occurs only if the e-mail was signed by other software which used SHA256 for DKIM (and there is no classic DomainKeys signature for this e-mail), and you need to check its signature on the machine with an older OS. In this case, Verify method will return Sha256NotSupported.

Although DK and DKIM are different technologies, DKIM uses the same DNS records, public and private keys and selectors as DK. Thus, checking both DK and DKIM signatures won't force Verify method to send two DNS queries (for DK and DKIM). Only a single query regarding DomainKeys record will be made.

Example

General examples are available in Sign and Verify topics. Another Sign example shows advanced usage of signing.

Requirements

Namespace: MailBee.Security

Assembly: MailBee.NET (in MailBee.NET.dll)

See Also

DomainKeys Members | MailBee.Security Namespace