DomainKeys Class |
Namespace: MailBee.Security
The DomainKeys type exposes the following members.
Name | Description | |
---|---|---|
DomainKeys |
Initializes a new instance of DomainKeys class.
| |
DomainKeys(Boolean) |
Initializes a new instance of DomainKeys class for use in web applications.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Sign(MailMessage, String, Byte, String) |
Signs a mail message with DomainKeys and DKIM signatures.
| |
Sign(MailMessage, String, Byte, String, DomainKeysTypes) |
Signs a mail message with DomainKeys and/or DKIM signatures.
| |
Sign(MailMessage, String, String, Boolean, String) |
Signs a mail message with DomainKeys and DKIM signatures.
| |
Sign(MailMessage, String, String, Boolean, String, DomainKeysTypes) |
Signs a mail message with DomainKeys and/or DKIM signatures.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Verify(MailMessage, Smtp) |
Verifies the DomainKeys and DKIM signatures of the mail message.
| |
Verify(MailMessage, Smtp, Header) |
Verifies the specified DomainKeys and/or DKIM signature of the mail message.
| |
Verify(MailMessage, Smtp, DomainKeysTypes) |
Verifies the DomainKeys and/or DKIM signatures of the mail message.
| |
VerifyAsync(MailMessage, Smtp) |
async/await version of Verify(MailMessage, Smtp).
| |
VerifyAsync(MailMessage, Smtp, Header) |
async/await version of Verify(MailMessage, Smtp, Header).
| |
VerifyAsync(MailMessage, Smtp, DomainKeysTypes) |
async/await version of Verify(MailMessage, Smtp, DomainKeysTypes).
|
Name | Description | |
---|---|---|
LastResult |
Gets a numeric code of the last error.
| |
ThrowExceptions |
Gets or sets whether the object will throw exceptions on errors.
|
Note |
---|
In many cases, you can use DomainKeysSign(Boolean, String, String, Boolean, String, DomainKeysTypes) 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. With OpenSSL, be sure to set the private key length to 1024 bits or more (DKIM itself does work with weaker keys but some providers like Gmail will not accept them). See RFC 4870 for more information on creating these keys.
Note |
---|
This class supports classic DomainKeys (DK) and newer DKIM technology. DK is always supported while DKIM support may require the system to support SHA256 algorithm. In case of a FIPS-compliant system, you should enable FipsMode and make sure you're using MailBee.NET.dll for .NET 4.0+. Read more on on SHA256 availability in DomainKeysVerifyResult topic. |
Although DK and DKIM are different technologies, DKIM uses the same DNS records, public/private keys and selectors as DK. Thus, checking both DK and DKIM signatures won't force Verify(MailMessage, Smtp) method to send two DNS queries (for DK and DKIM). Only a single query regarding DomainKeys record will be made.