Click or drag to resize
MimeKit

MimeMessageSign Method (CryptographyContext, DigestAlgorithm)

Sign the message using the specified cryptography context and digest algorithm.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public void Sign(
	CryptographyContext ctx,
	DigestAlgorithm digestAlgo
)

Parameters

ctx
Type: MimeKit.CryptographyCryptographyContext
The cryptography context.
digestAlgo
Type: MimeKit.CryptographyDigestAlgorithm
The digest algorithm.
Exceptions
ExceptionCondition
ArgumentNullExceptionctx is null.
InvalidOperationException

The Body has not been set.

-or-

A sender has not been specified.

ArgumentOutOfRangeException The digestAlgo was out of range.
NotSupportedException The digestAlgo is not supported.
CertificateNotFoundException A signing certificate could not be found for the sender.
PrivateKeyNotFoundException The private key could not be found for the sender.
Remarks
If either of the Resent-Sender or Resent-From headers are set, then the message will be signed using the Resent-Sender (or first mailbox in the Resent-From) address as the signer address, otherwise the Sender or From address will be used instead.
See Also