Class DkimSigner
Signs messages with DKIM (RFC 6376 §5). The signer adds a DKIM-Signature header to a message by computing the body hash, canonicalizing the signed headers, and signing the result with an RSA private key.
Inherited Members
Namespace: DRIT.Mail.Rfc.Dkim
Assembly: DRIT.Mail.dll
Syntax
public sealed class DkimSigner
Constructors
View SourceDkimSigner(DkimSignerOptions)
Initializes a new instance of the DkimSigner class with the specified options.
Declaration
public DkimSigner(DkimSignerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| DkimSignerOptions | options | The options controlling the operation. |
Methods
View SourceSign(MimeMessage)
Signs a MimeMessage by serializing it first, then signing the serialized bytes. The result is a new MimeMessage with the DKIM-Signature header prepended.
Declaration
public MimeMessage Sign(MimeMessage message)
Parameters
| Type | Name | Description |
|---|---|---|
| MimeMessage | message | The message to process. |
Returns
| Type | Description |
|---|---|
| MimeMessage |
Sign(byte[])
Signs the given raw message bytes and returns the signed message bytes. This is the preferred overload because DKIM operates on the exact byte representation of the message.
Declaration
public byte[] Sign(byte[] messageBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | messageBytes | The message bytes used by the operation. |
Returns
| Type | Description |
|---|---|
| byte[] |
Sign(Stream, Stream)
Signs the message read from input and writes the signed
message to output.
Declaration
public void Sign(Stream input, Stream output)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | input | Specifies the input value. |
| Stream | output | Specifies the output value. |