Dkim |
public class DkimSigner : DkimSignerBase
The DkimSigner type exposes the following members.
Name | Description | |
---|---|---|
DkimSigner(String, String, DkimSignatureAlgorithm) | Initialize a new instance of the DkimSigner class. | |
DkimSigner(AsymmetricKeyParameter, String, String, DkimSignatureAlgorithm) | Initialize a new instance of the DkimSigner class. | |
DkimSigner(Stream, String, String, DkimSignatureAlgorithm) | Initialize a new instance of the DkimSigner class. | |
DkimSigner(String, String, String, DkimSignatureAlgorithm) | Initialize a new instance of the DkimSigner class. |
Name | Description | |
---|---|---|
AgentOrUserIdentifier | Get or set the agent or user identifier. | |
BodyCanonicalizationAlgorithm |
Get or set the canonicalization algorithm to use for the message body.
(Inherited from DkimSignerBase) | |
Domain |
Get the domain that the signer represents.
(Inherited from DkimSignerBase) | |
HeaderCanonicalizationAlgorithm |
Get or set the canonicalization algorithm to use for the message headers.
(Inherited from DkimSignerBase) | |
PrivateKey |
Gets the private key.
(Inherited from DkimSignerBase) | |
QueryMethod | Get or set the public key query method. | |
Selector |
Get the selector subdividing the domain.
(Inherited from DkimSignerBase) | |
SignatureAlgorithm |
Get or set the algorithm to use for signing.
(Inherited from DkimSignerBase) | |
SignaturesExpireAfter |
Get or set the timespan after which signatures are no longer valid.
(Inherited from DkimSignerBase) |
Name | Description | |
---|---|---|
CreateSigningContext |
Create the digest signing context.
(Inherited from DkimSignerBase) | |
Equals | (Inherited from Object) | |
Finalize | (Inherited from Object) | |
GetHashCode | (Inherited from Object) | |
GetTimestamp | Get the timestamp value. | |
GetType | (Inherited from Object) | |
MemberwiseClone | (Inherited from Object) | |
Sign(MimeMessage, IListHeaderId) | Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature. | |
Sign(MimeMessage, IListString) | Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature. | |
Sign(FormatOptions, MimeMessage, IListHeaderId) | Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature. | |
Sign(FormatOptions, MimeMessage, IListString) | Digitally sign the message using a DomainKeys Identified Mail (DKIM) signature. | |
ToString | (Inherited from Object) |
public static void DkimSign (MimeMessage message) { var headers = new HeaderId[] { HeaderId.From, HeaderId.Subject, HeaderId.Date }; var signer = new DkimSigner ("privatekey.pem", "example.com", "brisbane", DkimSignatureAlgorithm.RsaSha256) { HeaderCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple, BodyCanonicalizationAlgorithm = DkimCanonicalizationAlgorithm.Simple, AgentOrUserIdentifier = "@eng.example.com", QueryMethod = "dns/txt", }; // Prepare the message body to be sent over a 7bit transport (such as older versions of SMTP). // Note: If the SMTP server you will be sending the message over supports the 8BITMIME extension, // then you can use `EncodingConstraint.EightBit` instead. message.Prepare (EncodingConstraint.SevenBit); signer.Sign (message, headers); }