Class DkimVerifier
Verifies DKIM signatures (RFC 6376 §6). The verifier finds all DKIM-Signature headers in a message, retrieves the public key from DNS, recomputes the body hash and header hash, and verifies the RSA signature.
Inherited Members
Namespace: DRIT.Mail.Rfc.Dkim
Assembly: DRIT.Mail.dll
Syntax
public sealed class DkimVerifier
Constructors
View SourceDkimVerifier()
Initializes a new instance of the DkimVerifier class with the default DNS-based key resolver.
Declaration
public DkimVerifier()
DkimVerifier(IDkimKeyResolver)
Initializes a new instance of the DkimVerifier class with the specified key resolver.
Declaration
public DkimVerifier(IDkimKeyResolver keyResolver)
Parameters
| Type | Name | Description |
|---|---|---|
| IDkimKeyResolver | keyResolver | The key resolver used by the operation. |
Methods
View SourceVerify(MimeMessage)
Verifies the DKIM signatures in a MimeMessage. The message is serialized first; this overload is only valid for unmodified messages.
Declaration
public DkimVerificationResult Verify(MimeMessage message)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeMessage | message | The message to process. |
Returns
| Type | Description |
|---|---|
| DkimVerificationResult |
Verify(byte[])
Verifies the DKIM signatures in the given raw message bytes.
Declaration
public DkimVerificationResult Verify(byte[] messageBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | messageBytes | The message bytes used by the operation. |
Returns
| Type | Description |
|---|---|
| DkimVerificationResult |
Verify(Stream)
Verifies the DKIM signatures in the message read from the given stream.
Declaration
public DkimVerificationResult Verify(Stream messageStream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | messageStream | The message stream used by the operation. |
Returns
| Type | Description |
|---|---|
| DkimVerificationResult |